log content-length when we get an error reading request
Fixes https://pagure.io/koji/issue/3288
This commit is contained in:
parent
a4a329f249
commit
c5ca8f39b9
2 changed files with 8 additions and 4 deletions
|
|
@ -15515,10 +15515,12 @@ def handle_upload(environ):
|
|||
str_e = str(e)
|
||||
logger.error(f"Error reading upload. Offset {offset}+{size}, path {fn}")
|
||||
if 'timeout' in str_e:
|
||||
logger.exception("Timed out reading input stream")
|
||||
logger.exception("Timed out reading input stream. "
|
||||
f"Content-Length: {context.environ.get('CONTENT_LENGTH')}")
|
||||
raise RequestTimeout(str_e)
|
||||
else:
|
||||
logger.exception("Error reading input stream")
|
||||
logger.exception("Error reading input stream. "
|
||||
f"Content-Length: {context.environ.get('CONTENT_LENGTH')}")
|
||||
raise BadRequest(str_e)
|
||||
if not chunk:
|
||||
break
|
||||
|
|
|
|||
|
|
@ -219,10 +219,12 @@ class ModXMLRPCRequestHandler(object):
|
|||
except OSError as e:
|
||||
str_e = str(e)
|
||||
if 'timeout' in str_e:
|
||||
self.logger.exception("Timed out reading input stream")
|
||||
self.logger.exception("Timed out reading input stream. "
|
||||
f"Content-Length: {context.environ.get('CONTENT_LENGTH')}")
|
||||
raise RequestTimeout(str_e)
|
||||
else:
|
||||
self.logger.exception("Error reading input stream")
|
||||
self.logger.exception("Error reading input stream. "
|
||||
f"Content-Length: {context.environ.get('CONTENT_LENGTH')}")
|
||||
raise BadRequest(str_e)
|
||||
if not chunk:
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue