Merge pull request #3997 from matrix-org/erikj/fix_profile_error_handling

Fix exception handling in fetching remote profiles
This commit is contained in:
Erik Johnston 2018-10-03 14:11:09 +01:00 committed by GitHub
commit 01afcfc4e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

1
changelog.d/3997.bugfix Normal file
View File

@ -0,0 +1 @@
Fix exception handling in fetching remote profiles

View File

@ -142,9 +142,7 @@ class BaseProfileHandler(BaseHandler):
if e.code != 404: if e.code != 404:
logger.exception("Failed to get displayname") logger.exception("Failed to get displayname")
raise raise
except Exception:
logger.exception("Failed to get displayname")
else:
defer.returnValue(result["displayname"]) defer.returnValue(result["displayname"])
@defer.inlineCallbacks @defer.inlineCallbacks
@ -199,8 +197,6 @@ class BaseProfileHandler(BaseHandler):
if e.code != 404: if e.code != 404:
logger.exception("Failed to get avatar_url") logger.exception("Failed to get avatar_url")
raise raise
except Exception:
logger.exception("Failed to get avatar_url")
defer.returnValue(result["avatar_url"]) defer.returnValue(result["avatar_url"])