brightway-lca / brightway2-data

Tools for the management of inventory databases and impact assessment methods. Part of the Brightway LCA framework.
https://docs.brightway.dev/
BSD 3-Clause "New" or "Revised" License
11 stars 24 forks source link

BW2Exception should inherit Exception (instead of BaseException) #190

Closed graham2071 closed 2 months ago

graham2071 commented 2 months ago

In errors.py

class BW2Exception(BaseException):

As stated in python documentation,

All built-in, non-system-exiting exceptions are derived from this class. All user-defined exceptions should also be derived from this class.

This caused me troubles when using brightway calculation in a huey task because it expects an Exception, not a BaseException, so the worker dies and task never ends. I could workaround it with a try / except and wrapping the original brigthway exception in an Exception.