pub enum OpClientError {
Http(String),
HeaderParse(String),
Serde(Error),
Io(Error),
Pem(String),
Pkcs8(String),
Base64(DecodeError),
Url(ParseError),
Signature(String),
Other(String),
}
Expand description
Error type for Open Payments client operations.
This enum provides detailed error information for different types of failures that can occur during client operations. Each variant includes context-specific error messages to help with debugging and error handling.
§Error Variants
Http
- Network and HTTP protocol errorsHeaderParse
- HTTP header parsing failuresSerde
- JSON serialization/deserialization errorsIo
- File system and I/O errorsPem
- PEM format parsing errorsPkcs8
- PKCS8 key format errorsBase64
- Base64 encoding/decoding errorsUrl
- URL parsing errorsSignature
- Cryptographic signature errorsOther
- Miscellaneous errors
Variants§
Http(String)
HTTP protocol or network-related errors.
This includes connection failures, timeout errors, and HTTP status code errors. The error message provides details about the specific HTTP issue.
HeaderParse(String)
HTTP header parsing errors.
Occurs when the client cannot parse required HTTP headers such as
Content-Type
, Authorization
, or custom headers.
Serde(Error)
JSON serialization or deserialization errors.
This error is automatically converted from serde_json::Error
and occurs
when the client cannot serialize request data or deserialize response data.
Io(Error)
File system and I/O errors.
This error is automatically converted from std::io::Error
and occurs
when the client cannot read key files or perform other I/O operations.
Pem(String)
PEM format parsing errors.
Occurs when the client cannot parse PEM-encoded private keys or certificates. This includes malformed PEM files or unsupported PEM types.
Pkcs8(String)
PKCS8 key format errors.
Occurs when the client cannot parse PKCS8-encoded private keys. This includes unsupported key algorithms or malformed key data.
Base64(DecodeError)
Base64 encoding or decoding errors.
This error is automatically converted from base64::DecodeError
and occurs
when the client cannot decode Base64-encoded data such as signatures or keys.
Url(ParseError)
URL parsing errors.
This error is automatically converted from url::ParseError
and occurs
when the client cannot parse URLs for wallet addresses or API endpoints.
Signature(String)
Cryptographic signature errors.
Occurs when there are issues with HTTP message signature creation or validation. This includes key loading failures, signature generation errors, and validation failures.
Other(String)
Miscellaneous errors that don’t fit into other categories.
This variant is used for unexpected errors that don’t fall into the standard error categories.