Exceptions¶
Every error raised by the package derives from
MypackageError and from the closest
standard-library exception.
graph TD
E[Exception] --> M[MypackageError]
V[ValueError] --> VE[ValidationError]
M --> VE
VE --> ES[EmptySeriesError]
R[RuntimeError] --> NF[NotFittedError]
M --> NF
exceptions
¶
Exception hierarchy for mypackage.
Every error raised by this package derives from
MypackageError, so a caller can trap the whole
package with a single except clause while still being able to discriminate
between failure modes when it matters.
The concrete errors also inherit from the closest standard-library exception
(ValueError, RuntimeError), so code written against the stdlib keeps
working without importing anything from this package.
MypackageError
¶
ValidationError
¶
Bases: MypackageError, ValueError
Raised when an argument fails validation.
Also a ValueError, so except ValueError still catches it.
Examples:
EmptySeriesError
¶
NotFittedError
¶
Bases: MypackageError, RuntimeError
Raised when a stateful transform is used before it has been fitted.
Examples: