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

@ -996,7 +996,7 @@ class MatrixFederationHttpClient:
logger.warning(
"{%s} [%s] %s", request.txn_id, request.destination, msg,
)
SynapseError(502, msg, Codes.TOO_LARGE)
raise SynapseError(502, msg, Codes.TOO_LARGE)
except Exception as e:
logger.warning(
"{%s} [%s] Error reading response: %s",