Raising instances of https://docs.python.org/3/library/exceptions.html#Exception[``Exception``] and https://docs.python.org/3/library/exceptions.html#BaseException[``BaseException``] will have a negative impact on any code trying to catch these exceptions.
What's more, it becomes difficult to catch only your exception. The best practice is to catch only exceptions which require a specific handling. When you raise ``Exception`` or ``BaseException`` in a function the caller will have to add an ``except Exception`` or ``except BaseException`` and re-raise all exceptions which were unintentionally caught. This can create tricky bugs when the caller forgets to re-raise exceptions such as ``SystemExit`` and the software cannot be stopped.
* raise a more specific https://docs.python.org/3/library/exceptions.html[Built-in exception] when one matches. For example ``TypeError`` should be raised when the type of a parameter is not the one expected.
* create a custom exception class deriving from ``Exception`` or one of its subclasses. A common practice for libraries is to have one custom root exception class from which every other custom exception class inherits. It enables other projects using this library to catch all errors coming from the library with a single "except" statement