Source code for utils.exceptions

"""Custom exception hierarchy for DifferentialLab.

All application-specific exceptions inherit from DifferentialLabError,
enabling broad ``except DifferentialLabError`` handling when desired.
"""


[docs] class DifferentialLabError(Exception): """Base exception for all DifferentialLab errors. Catch this to handle any application-defined error. """
[docs] class ValidationError(DifferentialLabError): """Raised when user input fails validation (domain, ICs, parameters, etc.)."""
[docs] class EquationParseError(DifferentialLabError): """Raised when an ODE/difference/PDE expression cannot be parsed or evaluated."""
[docs] class SolverFailedError(DifferentialLabError): """Raised when the numerical solver fails to converge or encounters an error."""