fix: replace bare except: with except Exception: (#29)
All checks were successful
Build Docker Image / build (pull_request) Successful in 2m7s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-05 15:03:16 -06:00
parent ddf5f77da4
commit efdbd623cf
2 changed files with 12 additions and 12 deletions

View File

@ -458,7 +458,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:
@ -519,7 +519,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:
@ -580,7 +580,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:
@ -2351,7 +2351,7 @@ class CustomCommand(BaseModel):
try:
import json
return json.loads(self.tags)
except:
except Exception:
return []
def set_tags_list(self, tags_list):

View File

@ -287,7 +287,7 @@ 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
@ -384,7 +384,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')
@ -445,7 +445,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')
@ -528,7 +528,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')
@ -736,7 +736,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'),
@ -821,7 +821,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
@ -901,7 +901,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
@ -981,7 +981,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')