Merge pull request #3639 from matrix-org/rav/refactor_error_handling

Clean up handling of errors from outbound requests
This commit is contained in:
Richard van der Hoff 2018-08-02 17:38:24 +01:00 committed by GitHub
commit 1fa98495d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 124 additions and 142 deletions

View file

@ -379,7 +379,7 @@ class MediaRepository(object):
logger.warn("HTTP error fetching remote media %s/%s: %s",
server_name, media_id, e.response)
if e.code == twisted.web.http.NOT_FOUND:
raise SynapseError.from_http_response_exception(e)
raise e.to_synapse_error()
raise SynapseError(502, "Failed to fetch remote media")
except SynapseError: