oxidecomputer / amd-apcb

AMD Generic Encapsulated Software Architecture Platform Security Processor Configuration Block manipulation library
Mozilla Public License 2.0
13 stars 1 forks source link

Improve error reporting in general #94

Open daym opened 1 year ago

daym commented 1 year ago

We could add context to our errors so we have something like this

    GroupNotFound{group: GroupId},
    GroupUniqueKeyViolation{group: GroupId},
    GroupTypeMismatch{group: GroupId, signature: [u8; 4]},
    EntryNotFound{entry: EntryId},
    EntryUniqueKeyViolation{entry: EntryId},
    EntryTypeMismatch(entry: EntryId, type!?),
    TokenNotFound{entry: EntryId, token: u32},
    TokenOrderingViolation{EntryId, token: u32},
    TokenUniqueKeyViolation{EntryId, token: u32},
    TokenRange{entry: EntryId, token: u32},
    ParameterNotFound{entry: EntryId, time_point: ParameterTimePoint, token: ParameterTokenConfig},
    ParameterRange{entry: EntryId, time_point: ParameterTimePoint, token: ParameterTokenConfig, value_frontier: u16},
    EntryNotExtractable{entry: EntryId},