Error classes
jakos opened this issue · 1 comments
jakos commented
Create error classes that will be used in project. Change already used builtin error classes.
lhaze commented
I have a concept how to work with business process errors in a more convenient way than usual:
- Have core of the application totally language independent; use error codes and translate them to literals in some language as late as possible: in the Presenter component of the server side or in the client side application.
- Gather business logic errors in catalogs: an
Enum
-like class that gathers instances of errors concerning business validations & process interrupts of some specific domain. Look at theLogicErrors
class in Valian/python-business-logic for an example how it could be done. - Libraries shouldn't use builtin error classes for two reasons:
- Depending application might want to catch all exceptions specific to the
pca
only. - Raising eg.
KeyError
orTypeError
may unexpectedly interact with someKey/TypeError
naturally raised by syntax or runtime.
- Depending application might want to catch all exceptions specific to the