unmbt/ciallo-data/codec does not have a README file

    DataError

    pub(all) suberror DataError {
    ConnectionFailed(String)
    PoolExhausted(timeout_ms~ : Int)
    Timeout(op~ : String, elapsed_ms~ : Int64)
    ProtocolError(String)
    AuthFailed(String)
    DecodeFailed(field~ : String, message~ : String)
    NotFound(entity~ : String, detail~ : String)
    UniqueViolation(constraint~ : String, detail~ : String)
    ForeignKeyViolation(constraint~ : String, detail~ : String)
    OptimisticLockConflict(entity~ : String, expected_version~ : Int64)
    TxAlreadyClosed
    BackendError(code~ : String, message~ : String)
    } derive(Eq,
    Debug
    )

    统一数据套件错误类型(覆盖连接池、超时、协议、鉴权、解码、约束冲突与乐观锁冲突)

    DataError::code

    fn DataError::code(self : DataError) -> String

    返回稳定的错误机器码,供上层 HTTP RFC 9457 映射或日志聚合复用

    DataError::summary

    fn DataError::summary(self : DataError) -> String

    返回可读错误摘要(脱敏,可直接写入 QuerySpan::error_summary)

    Source Files