4.5. ADR-005: Use thiserror as error handling library

4.5.1. Status

Accepted

Date: 2026-07-28

4.5.2. Context

The Classic Diagnostic Adapter needs to provide detailed error information, both via its HTTP endpoints and when used as a library by OEMs to implement their concrete distribution.

The different error cases need to be programmatically matchable, so that consumers can decide whether to retry operations or abort them altogether.

4.5.3. Decision

We will use thiserror as the error handling library for the Classic Diagnostic Adapter.

We will explicitly not use anyhow, even though it is commonly paired with thiserror for use in application code, because virtually all production code in Classic Diagnostic Adapter can used as a library, when OEMs implement their distribution.

4.5.4. Rationale

4.5.4.1. Other error handling libraries

Other error handling libraries such as snafu or eyre were not evaluated in this decision.

4.5.5. References