Properly raise an exception when the body exceeds the max size. (#9145)

...instead of just creating the exception object and doing nothing with it.
This commit is contained in:
Patrick Cloke 2021-01-18 10:21:42 -05:00 committed by GitHub
parent 02070c69fa
commit 2b467d0b61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View file

@ -724,7 +724,7 @@ class SimpleHttpClient:
read_body_with_max_size(response, output_stream, max_size)
)
except BodyExceededMaxSize:
SynapseError(
raise SynapseError(
502,
"Requested file is too large > %r bytes" % (max_size,),
Codes.TOO_LARGE,