mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 15:48:53 -05:00
replace 'except:' with 'except Exception:'
what could possibly go wrong
This commit is contained in:
parent
ecf198aab8
commit
eaaabc6c4f
54 changed files with 93 additions and 93 deletions
|
|
@ -93,7 +93,7 @@ class ClientDirectoryServer(ClientV1RestServlet):
|
|||
)
|
||||
except SynapseError as e:
|
||||
raise e
|
||||
except:
|
||||
except Exception:
|
||||
logger.exception("Failed to create association")
|
||||
raise
|
||||
except AuthError:
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class PresenceStatusRestServlet(ClientV1RestServlet):
|
|||
raise KeyError()
|
||||
except SynapseError as e:
|
||||
raise e
|
||||
except:
|
||||
except Exception:
|
||||
raise SynapseError(400, "Unable to parse state")
|
||||
|
||||
yield self.presence_handler.set_state(user, state)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class ProfileDisplaynameRestServlet(ClientV1RestServlet):
|
|||
|
||||
try:
|
||||
new_name = content["displayname"]
|
||||
except:
|
||||
except Exception:
|
||||
defer.returnValue((400, "Unable to parse name"))
|
||||
|
||||
yield self.profile_handler.set_displayname(
|
||||
|
|
@ -94,7 +94,7 @@ class ProfileAvatarURLRestServlet(ClientV1RestServlet):
|
|||
content = parse_json_object_from_request(request)
|
||||
try:
|
||||
new_name = content["avatar_url"]
|
||||
except:
|
||||
except Exception:
|
||||
defer.returnValue((400, "Unable to parse name"))
|
||||
|
||||
yield self.profile_handler.set_avatar_url(
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ class JoinRoomAliasServlet(ClientV1RestServlet):
|
|||
|
||||
try:
|
||||
content = parse_json_object_from_request(request)
|
||||
except:
|
||||
except Exception:
|
||||
# Turns out we used to ignore the body entirely, and some clients
|
||||
# cheekily send invalid bodies.
|
||||
content = {}
|
||||
|
|
@ -247,7 +247,7 @@ class JoinRoomAliasServlet(ClientV1RestServlet):
|
|||
room_id = room_identifier
|
||||
try:
|
||||
remote_room_hosts = request.args["server_name"]
|
||||
except:
|
||||
except Exception:
|
||||
remote_room_hosts = None
|
||||
elif RoomAlias.is_valid(room_identifier):
|
||||
handler = self.handlers.room_member_handler
|
||||
|
|
@ -587,7 +587,7 @@ class RoomMembershipRestServlet(ClientV1RestServlet):
|
|||
|
||||
try:
|
||||
content = parse_json_object_from_request(request)
|
||||
except:
|
||||
except Exception:
|
||||
# Turns out we used to ignore the body entirely, and some clients
|
||||
# cheekily send invalid bodies.
|
||||
content = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue