Spine-Toolbox
Spine-Toolbox copied to clipboard
More robust error handling
At least in some parts of the code, e.g. data_store.py
from spine-items
, error handling is currently done by emitting the errors where they happen. If it is a benign/expected error, the logger is set to None
to suppress the output. This poses problems when a function could both raise benign and real errors.
Instead, specific exceptions could be raised and caught. This would give more flexibility for error handling and facilitate a pythonic "ask for forgiveness instead of permission" style with try
/except
, since except
could then distinguish between different types of exceptions.
I took the liberty to move this issue here because Spine-Toolbox issue tracker is also used for issues in spine-items. It is just to keep the number of relevant issue trackers down to three.