Skip to content
Vinicius Reif Biavatti edited this page Jul 25, 2022 · 1 revision
  • Use a good representation name
  • Do not use underscore to separate
  • Use camel case
  • Do not use special symbols
  • Do not use letters to represent the type like "E" for Error
  • Use the 'Error' suffix in the exception class name
  • Extends the Exception class or subclass
  • Never extend the "BaseException" class. Use it for an specific situation only

✅ Do

class ValidationError(Exception):
    ...

❌ Don't

class ValidationException(Exception):
    ...

class EValidation(Exception):
    ...
Clone this wiki locally