|
Stratax 0.4.0rc1
|
Header: include/stratax/exceptions/Exceptions.hpp
Stratax uses a small exception hierarchy for runtime errors. Each exception contains only the message supplied when it is thrown. There are no error codes, metadata objects, source-location fields, or named exception factories.
Checks are performed directly where their invariants matter:
Every derived class inherits the constructors of StrataxError, so it can be constructed directly from a message. Specialized errors can also be caught as Exceptions::StrataxError or std::runtime_error.
| Exception | Use |
|---|---|
ShapeError | Invalid shape or incompatible element count |
DimensionError | Invalid dimension or dimension arithmetic overflow |
RankError | Incorrect number of dimensions, indices, or slices |
IndexError | Invalid index or unsupported slice |
TypeError | Unsupported runtime type |
BroadcastError | Incompatible broadcast shapes |
ZeroDivisionError | Division by zero or undefined empty statistic |
AxisError | Invalid reduction axis |
OverflowError | Signed division minimum by minus one and explicit conversion overflow; other arithmetic is not generally checked |
ValueError | Invalid value that does not fit another category |
All exception classes are declared by Exceptions.hpp; there are no separate family headers.
Python registers these classes beneath stratax.StrataxError, but some argument conversion and slice parsing errors use built-in Python exception classes. See Python API Reference for that boundary.