I am currently working on a subsystem in Python, which has a following structure:
- Facade, which provides interface for communication with other subsystems (name it
MyFacade) - Engine (singleton) - receives requests from facade and dispathes them to "working" classes (
MyEngine) - Working modules - such as
MyFileSystem,MyNetwork,MyDBand so on.
Thus there are three general levels: Facade - Engine - Worker.
If an error occurs somewhere - Facade must get it and show it to client, and application must not crash.
The question is: what is the best-practice Python way to organize error handling errors on all three levels of abstraction?
If an error occurs on the lowest level (Worker) - should I catch it, or return None/False?
What should be done on upper levels to provide necessary functionality and avoid violating DRY, SRP and so on?
Thx in advance!
Aucun commentaire:
Enregistrer un commentaire