Skip to content

Commit

Permalink
Improve variable resolution error handling in command processing
Browse files Browse the repository at this point in the history
  • Loading branch information
raimannma committed Feb 6, 2025
1 parent f7d59b0 commit 017d983
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions deadlock_data_api/routers/v1_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,13 @@ def get_variables_resolve(
"hero_name": hero_name,
}
try:
resolved_variables = {
name: resolver(**kwargs) for name, resolver in variable_resolvers if name in variables
}
resolved_variables = {}
for name, resolver in variable_resolvers:
if name in variables:
try:
resolved_variables[name] = resolver(**kwargs)
except CommandResolveError:
resolved_variables[name] = None
LOGGER.info(f"Resolved variables: {resolved_variables}")
return resolved_variables
except CommandResolveError as e:
Expand Down

0 comments on commit 017d983

Please sign in to comment.