I have a module with several files, some of which have a few custom exceptions declared. These exceptions are primarily raised in the file they are declared, but sometimes they are also raised in other files in the module. Is it best practice to just make a new file (ie errors.py
) and put all exceptions there, or continue to keep them in there respective files?
Asked
Active
Viewed 552 times
2

Ian
- 5,704
- 6
- 40
- 72
-
All custom exceptions in one file seems best to me. IMHO, do what you think is best from a maintenance perspective. – Rambarun Komaljeet Feb 01 '19 at 18:45
-
This question maybe too broad for stackoverflow. Can you please ask them in the sites like https://softwareengineering.stackexchange.com/. – v.coder Feb 01 '19 at 20:08