Skip to main content

Module error

Module error 

Source
Expand description

Error type for DACE operations.

DACE’s C core uses a sticky thread-local error code (XYY: severity X, number YY) that is polled by the caller, and calls exit(1) on internal panic-level failures. dace-rs instead:

  • reports recoverable failures (initialization, parsing, blob import) as Result::Err holding a DaceError carrying the same numeric XYY code as the C library;
  • panics with a DaceError payload for numeric/domain misuse during operations (division by zero, logarithm of a non-positive DA, …), since the operator traits (Mul, Div, …) cannot return Result;
  • downgrades the C library’s purely informational messages (severity INFO/WARNING) to log records with documented degraded behavior, mirroring the C library instead of failing.

There is no sticky error state and no exit.

Structs§

DaceError
A DACE error: a numeric XYY code (severity X in {1,3,6,9,10}, number YY) plus a human-readable message, matching the C library’s error table.