errors

errors#

Full path: iqm.station_control.interface.errors

Data models and mapping utilities for IQM REST API error handling.

This module provides the IQMServerError DTO, which defines the standard JSON structure for error responses across the IQM ecosystem. It also contains the logic to bridge the gap between HTTP status codes and the IQMError exception hierarchy.

The mapping logic supports:

  1. Serialization & Encoding: Transforming server-side exceptions into

    IQMServerError payloads while determining the appropriate HTTP status code and preserving error metadata (codes, messages, and sources).

  2. Reconstruction & Decoding: Converting received IQMServerError

    data back into the IQMError hierarchy on the client side, ensuring failure data remains actionable in application logic.

Functions

map_from_error_to_status_code(error)

Map a IQMError to an HTTPStatus code.

map_from_status_code_to_error(status_code)

Map an HTTPStatus code to a IQMError.

Classes

IQMServerError

Data transfer model for communicating error details over the REST API.

Inheritance

Inheritance diagram of iqm.station_control.interface.errors