Expand description
BDEW ERC error codes — structured rejection codes for APERAK and CONTRL.
BDEW ERC codes appear in:
- APERAK
ERCsegments: processability errors returned by the receiving party when it cannot process a message (BGM+313).
CONTRL carries no ERC: it reports a syntax failure in UCI/UCM
DE 0085, which is a different vocabulary and not this module’s.
This module provides a validated ErcCode newtype, a catalogue of
standard code string constants in codes, and ErcAction — a
machine-readable recommended automated response for each code.
Domain crates match on the ERC code to drive typed ERP automation
instead of freeform text parsing.
§Separation of concerns
| Layer | Responsibility |
|---|---|
edi-energy | Wire-format parsing; raw String from ERC segment |
mako-engine::erc | Validated type; constants; role-agnostic ErcAction recommendation |
| Domain crates | Process-specific match on ErcCode → domain decision |
makod | ErcCode in outbox payload → makoerc CloudEvents extension |
§Regulatory sources
- APERAK MIG 2.1i / 2.2 —
SG4 ERCC901 DE 9321, the code table - APERAK AHB 1.0 / 1.1 — which codes each Anwendungsfall admits, and the
Bedingungen that oblige the
SG5 FTX+Z02Ortsangabe - Allgemeine Festlegungen V6.1d (01.04.2026) — §4 rejection handling
§Example
use mako_engine::erc::{ErcCode, ErcAction, codes, recommended_action};
let code = ErcCode::new(codes::Z39);
assert!(matches!(
recommended_action(&code),
ErcAction::RetryWithCorrection { field: "message" }
));Modules§
- codes
- The
ERCDE 9321 „Anwendungsfehler, Code“ values, verbatim from the APERAK MIG 2.1i code table. There is no second vocabulary:CONTRLreports syntax failures inUCI/UCMDE 0085, not in anERC, and a code outside this list is refused by the receiving Marktpartner’s own Prüfschablone.
Structs§
- ErcCode
- A BDEW
ERCDE 9321 error code from an inbound APERAK.
Enums§
- ErcAction
- Recommended automated response for a received ERC rejection code.
Functions§
- recommended_
action - Return the recommended automated ERP action for a received ERC code.
- requires_
ortsangabe - Whether an ERC code obliges the
SG5 FTX+Z02Ortsangabe des AHB-Fehlers.