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
ERCsegments: syntax and data-validation errors.
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 AHB 1.0 (FV2025-10-01 / FV2026-10-01) — ERC segment, §2.2/§2.3
- CONTRL AHB 1.0 (FV2025-10-01 / FV2026-10-01) — ERC segment, §2.2
- 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::E02);
assert!(matches!(
recommended_action(&code),
ErcAction::RetryWithCorrection { field: "address" }
));Modules§
- codes
- Standard BDEW ERC error code string constants.
Structs§
- ErcCode
- A BDEW ERC error code from an inbound APERAK or CONTRL.
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.