Exceptions¶
Custom exception hierarchy for HyPlan.
All HyPlan-specific exceptions inherit from HyPlanError, making it
easy to catch any library error with a single except HyPlanError clause
while still allowing callers to handle specific error categories.
Exception hierarchy:
HyPlanError (base)
├── HyPlanValueError — invalid argument values
├── HyPlanTypeError — incorrect argument types
└── HyPlanRuntimeError — runtime / state errors (e.g. data not loaded)
- exception HyPlanValueError[source]¶
Bases:
HyPlanError,ValueErrorRaised when an argument has the right type but an invalid value.
Inherits from both
HyPlanErrorandValueErrorso that existingexcept ValueErrorhandlers continue to work.
- exception HyPlanTypeError[source]¶
Bases:
HyPlanError,TypeErrorRaised when an argument has an unexpected type.
Inherits from both
HyPlanErrorandTypeErrorso that existingexcept TypeErrorhandlers continue to work.
- exception HyPlanRuntimeError[source]¶
Bases:
HyPlanError,RuntimeErrorRaised for runtime or state errors (e.g. required data not loaded).
Inherits from both
HyPlanErrorandRuntimeErrorso that existingexcept RuntimeErrorhandlers continue to work.