replace 'except:' with 'except Exception:'

what could possibly go wrong
This commit is contained in:
Richard van der Hoff 2017-10-23 15:52:32 +01:00
parent ecf198aab8
commit eaaabc6c4f
54 changed files with 93 additions and 93 deletions

View file

@ -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

View file

@ -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:

View file

@ -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)

View file

@ -66,7 +66,7 @@ def prepare_database(db_conn, database_engine, config):
cur.close()
db_conn.commit()
except:
except Exception:
db_conn.rollback()
raise

View file

@ -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)

View file

@ -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

View file

@ -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(