-
Notifications
You must be signed in to change notification settings - Fork 0
Exception messages can lack detail when using str(e) #22
Copy link
Copy link
Closed
Description
For input variants which don't have a source field because there is no representation, the output in the errors field is just "source".
This is because
>>> d = {"A": 1}
>>> try: d["source"]
... except Exception as e: print(str(e))
...
'source'even though
>>> d["source"]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'source'Using repr(e) instead using the default str(e) conversion would be a quick way to add a bit more context without needing to add if checks on all key accesses.
>>> try: d["source"]
... except Exception as e: print(repr(e))
...
KeyError('source')clinvar-gk-python/clinvar_gk_pilot/main.py
Line 289 in 6d69634
| return {"errors": str(e)} |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels