#[non_exhaustive]pub enum Error {
Show 13 variants
InvalidKeyLength {
algorithm: &'static str,
expected: usize,
actual: usize,
},
InvalidIvLength {
mode: &'static str,
expected: usize,
actual: usize,
},
InvalidCollapseId {
actual: usize,
},
MissingMessageIdForDelete,
EmptyMessage,
InvalidHeaderValue {
name: &'static str,
source: InvalidHeaderValue,
},
HttpClient(Error),
Http(Error),
Jwt(Error),
Json(Error),
Encryption,
Random(String),
ApnsFailures(String),
}Expand description
Error type for Bark APNs operations.
The enum is non-exhaustive so the crate can add more precise variants later
without breaking downstream code. Applications can convert it into
anyhow::Error with ?, while libraries can match individual variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidKeyLength
The encryption key length does not match the selected AES algorithm.
Fields
InvalidIvLength
The IV length does not match the selected AES mode.
Fields
InvalidCollapseId
The message id is too long to be used as an APNs collapse id.
MissingMessageIdForDelete
A delete message was serialized or sent without an id.
EmptyMessage
A normal non-delete message has neither body nor markdown.
InvalidHeaderValue
A value could not be encoded as an APNs HTTP header.
Fields
source: InvalidHeaderValueUnderlying header parsing error.
HttpClient(Error)
The HTTP client could not be constructed.
Http(Error)
An HTTP request failed before receiving a per-device APNs response.
Jwt(Error)
APNs provider-token generation failed.
Json(Error)
JSON serialization failed.
Encryption
Encryption failed after input validation.
Random(String)
Random IV generation failed.
ApnsFailures(String)
One or more device tokens failed during a multi-device send.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()