Merge "Add info to RequestEntityTooLarge exception."
This commit is contained in:
commit
e228d9eff9
1 file changed
+6
-1
@@ -200,7 +200,12 @@ class LimitingReader(object):
|
||||
self.sha1.update(res)
|
||||
self.sha256.update(res)
|
||||
if self.bytes_read > self.limit:
|
||||
raise exception.RequestEntityTooLarge()
|
||||
message = (_("The server is refusing to process a request because"
|
||||
" the request entity with size of %(blob_length)s"
|
||||
" bytes, is larger than the server is willing or able"
|
||||
" to process - %(limit)s bytes.") %
|
||||
{"blob_length": len_result, "limit": self.limit})
|
||||
raise exception.RequestEntityTooLarge(message=message)
|
||||
return res
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user