You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could/should improve the Karabo error and warning handling. What I mean by that is the following:
Error-Handling
For errors we throw, we should always use custom errors. The reason is because if someone wants to do proper error-handling on their side, we would make it much easier for them. They could just e.g. catch KaraboError (or any inherited error from KaraboError) to just handle errors we throw. However, we also should also follow the Python built-in exception specification. Therefore I suggest the following error-structure, which inherit always from KaraboError and the according built-in exception:
For warnings, we should also use custom warnings. This makes it way easier for a third-party user to ignore karabo-specific warnings without ignoring other warnings of the same kind. The inheritance structure is the same as for exceptions:
This specific approach would enhance the error and warning handling possibilities for a third-party user by a lot. The only requirement for us to just throw KaraboError (inherited) and use KaraboWarning (inherited).
The text was updated successfully, but these errors were encountered:
We could/should improve the Karabo error and warning handling. What I mean by that is the following:
Error-Handling
KaraboError
(or any inherited error fromKaraboError
) to just handle errors we throw. However, we also should also follow the Python built-in exception specification. Therefore I suggest the following error-structure, which inherit always fromKaraboError
and the according built-in exception:Waring-Handling
This specific approach would enhance the error and warning handling possibilities for a third-party user by a lot. The only requirement for us to just throw
KaraboError
(inherited) and useKaraboWarning
(inherited).The text was updated successfully, but these errors were encountered: