enthought / envisage

Envisage is a Python-based framework for building applications whose functionalities can be extended by adding "plug-ins".
http://docs.enthought.com/envisage/
Other
81 stars 26 forks source link

replace system errors #529

Closed homosapien-lcy closed 1 year ago

homosapien-lcy commented 1 year ago

System error is widely used in the envisage project. However, this type of error is not very descriptive. Thus in this PR we are attempting to replace these errors with more descriptive errors.

Closes #442

homosapien-lcy commented 1 year ago

This is my first time work with various errors here, so I will put my thought process here: There are 3 main category of systemerror used in this project: 1 related to plugin_id (such as line 158 in envisage/composite_plugin_manager.py), this is caused by plugin cannot be found for the specified plugin id and thus gives a None, I replaced it with value error (Raised when an operation or function receives an argument that has the right type but an inappropriate value) 2 related to no compatible egg is found (such as line 156 in envisage/egg_basket_plugin_manager.py), this is caused by an error during runtime, so I use RuntimeError 3 related to unknown ETSConfig.toolkit (such as line 48 in examples/legacy/plugins/workbench/AcmeLab/acme/workbench/view/color_view.py), this is caused by toolkit not found in the attribute, which is during runtime, I would classified as RuntimeError

Reference: List of errors: https://docs.python.org/3/library/exceptions.html

homosapien-lcy commented 1 year ago

OK, new comments are addressed

mdickinson commented 1 year ago

OK, new comments are addressed

Thank you! Just one left - please could you fix the TraitError import?