Spine-Toolbox icon indicating copy to clipboard operation
Spine-Toolbox copied to clipboard

More robust error handling

Open OleMussmann opened this issue 1 year ago • 1 comments

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.

OleMussmann avatar Mar 17 '23 11:03 OleMussmann

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.

soininen avatar Mar 17 '23 11:03 soininen