fix: replace bare except: with except Exception: (#29)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0e132e602f
commit
5ac9cce7f0
@ -452,7 +452,7 @@ class Team(BaseModel):
|
||||
active_roster['WARa'] -= move.player.wara
|
||||
try:
|
||||
active_roster['players'].remove(move.player)
|
||||
except:
|
||||
except Exception:
|
||||
print(f'I could not drop {move.player.name}')
|
||||
|
||||
for move in all_adds:
|
||||
@ -513,7 +513,7 @@ class Team(BaseModel):
|
||||
# print(f'SIL dropping {move.player.name} id ({move.player.get_id()}) for {move.player.wara} WARa')
|
||||
try:
|
||||
short_roster['players'].remove(move.player)
|
||||
except:
|
||||
except Exception:
|
||||
print(f'I could not drop {move.player.name}')
|
||||
|
||||
for move in all_adds:
|
||||
@ -574,7 +574,7 @@ class Team(BaseModel):
|
||||
# print(f'LIL dropping {move.player.name} id ({move.player.get_id()}) for {move.player.wara} WARa')
|
||||
try:
|
||||
long_roster['players'].remove(move.player)
|
||||
except:
|
||||
except Exception:
|
||||
print(f'I could not drop {move.player.name}')
|
||||
|
||||
for move in all_adds:
|
||||
@ -2345,7 +2345,7 @@ class CustomCommand(BaseModel):
|
||||
try:
|
||||
import json
|
||||
return json.loads(self.tags)
|
||||
except:
|
||||
except Exception:
|
||||
return []
|
||||
|
||||
def set_tags_list(self, tags_list):
|
||||
|
||||
@ -296,9 +296,8 @@ async def get_custom_commands(
|
||||
if command_dict.get("tags"):
|
||||
try:
|
||||
command_dict["tags"] = json.loads(command_dict["tags"])
|
||||
except:
|
||||
except Exception:
|
||||
command_dict["tags"] = []
|
||||
|
||||
# Get full creator information
|
||||
creator_id = command_dict["creator_id"]
|
||||
creator_cursor = db.execute_sql(
|
||||
@ -406,7 +405,7 @@ async def create_custom_command_endpoint(
|
||||
if command_dict.get("tags"):
|
||||
try:
|
||||
command_dict["tags"] = json.loads(command_dict["tags"])
|
||||
except:
|
||||
except Exception:
|
||||
command_dict["tags"] = []
|
||||
|
||||
creator_created_at = command_dict.pop("creator_created_at")
|
||||
@ -467,7 +466,7 @@ async def update_custom_command_endpoint(
|
||||
if command_dict.get("tags"):
|
||||
try:
|
||||
command_dict["tags"] = json.loads(command_dict["tags"])
|
||||
except:
|
||||
except Exception:
|
||||
command_dict["tags"] = []
|
||||
|
||||
creator_created_at = command_dict.pop("creator_created_at")
|
||||
@ -552,7 +551,7 @@ async def patch_custom_command(
|
||||
if command_dict.get("tags"):
|
||||
try:
|
||||
command_dict["tags"] = json.loads(command_dict["tags"])
|
||||
except:
|
||||
except Exception:
|
||||
command_dict["tags"] = []
|
||||
|
||||
creator_created_at = command_dict.pop("creator_created_at")
|
||||
@ -781,7 +780,7 @@ async def get_custom_command_stats():
|
||||
if command_dict.get("tags"):
|
||||
try:
|
||||
command_dict["tags"] = json.loads(command_dict["tags"])
|
||||
except:
|
||||
except Exception:
|
||||
command_dict["tags"] = []
|
||||
command_dict["creator"] = {
|
||||
"discord_id": command_dict.pop("creator_discord_id"),
|
||||
@ -881,7 +880,7 @@ async def get_custom_command_by_name_endpoint(command_name: str):
|
||||
if command_dict.get("tags"):
|
||||
try:
|
||||
command_dict["tags"] = json.loads(command_dict["tags"])
|
||||
except:
|
||||
except Exception:
|
||||
command_dict["tags"] = []
|
||||
|
||||
# Add creator info - get full creator record
|
||||
@ -966,7 +965,7 @@ async def execute_custom_command(
|
||||
if updated_dict.get("tags"):
|
||||
try:
|
||||
updated_dict["tags"] = json.loads(updated_dict["tags"])
|
||||
except:
|
||||
except Exception:
|
||||
updated_dict["tags"] = []
|
||||
|
||||
# Build creator object from the fields returned by get_custom_command_by_id
|
||||
@ -1053,7 +1052,7 @@ async def get_custom_command(command_id: int):
|
||||
if command_dict.get("tags"):
|
||||
try:
|
||||
command_dict["tags"] = json.loads(command_dict["tags"])
|
||||
except:
|
||||
except Exception:
|
||||
command_dict["tags"] = []
|
||||
|
||||
creator_created_at = command_dict.pop("creator_created_at")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user