Skip to content

Commit

Permalink
Catch exceptions raised while formatting specific tasks instruction. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Aadesh-Baral authored Jun 29, 2023
1 parent 350bd34 commit 7a5e268
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/models/postgis/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,10 @@ def format_per_task_instructions(self, instructions) -> str:

try:
instructions = instructions.format(**properties)
except KeyError:
except (KeyError, ValueError, IndexError):
# KeyError is raised if a format string contains a key that is not in the dictionary, e.g. {foo}
# ValueError is raised if a format string contains a single { or }
# IndexError is raised if a format string contains empty braces, e.g. {}
pass
return instructions

Expand Down

0 comments on commit 7a5e268

Please sign in to comment.