dpp-domain 0.19.0

EU Digital Product Passport domain types, port traits, and per-field disclosure policy
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! [`GlnError`] — why a GLN string was refused.

use thiserror::Error;

/// Error from constructing a [`Gln`](super::Gln).
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum GlnError {
    #[error("GLN must be exactly 13 ASCII digits, got '{0}'")]
    InvalidFormat(String),
    #[error("GLN check digit invalid for '{gln}': expected {expected}, got {actual}")]
    InvalidCheckDigit {
        gln: String,
        expected: u8,
        actual: u8,
    },
}