mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-11 22:00:03 -04: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
|
@ -103,7 +103,7 @@ class LoggingTransaction(object):
|
|||
"[SQL values] {%s} %r",
|
||||
self.name, args[0]
|
||||
)
|
||||
except:
|
||||
except Exception:
|
||||
# Don't let logging failures stop SQL from working
|
||||
pass
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ class BackgroundUpdateStore(SQLBaseStore):
|
|||
result = yield self.do_next_background_update(
|
||||
self.BACKGROUND_UPDATE_DURATION_MS
|
||||
)
|
||||
except:
|
||||
except Exception:
|
||||
logger.exception("Error doing update")
|
||||
else:
|
||||
if result is None:
|
||||
|
|
|
@ -1481,7 +1481,7 @@ class EventsStore(SQLBaseStore):
|
|||
for i in ids
|
||||
if i in res
|
||||
])
|
||||
except:
|
||||
except Exception:
|
||||
logger.exception("Failed to callback")
|
||||
with PreserveLoggingContext():
|
||||
reactor.callFromThread(fire, event_list, row_dict)
|
||||
|
|
|
@ -66,7 +66,7 @@ def prepare_database(db_conn, database_engine, config):
|
|||
|
||||
cur.close()
|
||||
db_conn.commit()
|
||||
except:
|
||||
except Exception:
|
||||
db_conn.rollback()
|
||||
raise
|
||||
|
||||
|
|
|
@ -636,7 +636,7 @@ class RoomMemberStore(SQLBaseStore):
|
|||
room_id = row["room_id"]
|
||||
try:
|
||||
content = json.loads(row["content"])
|
||||
except:
|
||||
except Exception:
|
||||
continue
|
||||
|
||||
display_name = content.get("displayname", None)
|
||||
|
|
|
@ -22,7 +22,7 @@ def run_create(cur, database_engine, *args, **kwargs):
|
|||
# NULL indicates user was not registered by an appservice.
|
||||
try:
|
||||
cur.execute("ALTER TABLE users ADD COLUMN appservice_id TEXT")
|
||||
except:
|
||||
except Exception:
|
||||
# Maybe we already added the column? Hope so...
|
||||
pass
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ class SearchStore(BackgroundUpdateStore):
|
|||
etype = row["type"]
|
||||
try:
|
||||
content = json.loads(row["content"])
|
||||
except:
|
||||
except Exception:
|
||||
continue
|
||||
|
||||
if etype == "m.room.message":
|
||||
|
@ -407,7 +407,7 @@ class SearchStore(BackgroundUpdateStore):
|
|||
origin_server_ts, stream = pagination_token.split(",")
|
||||
origin_server_ts = int(origin_server_ts)
|
||||
stream = int(stream)
|
||||
except:
|
||||
except Exception:
|
||||
raise SynapseError(400, "Invalid pagination token")
|
||||
|
||||
clauses.append(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue