Skip to main content

foctet_http/
error.rs

1use foctet_core::BodyEnvelopeError;
2use thiserror::Error;
3
4/// Error type for HTTP integration over `foctet-core` body envelopes.
5#[derive(Debug, Error)]
6pub enum HttpError {
7    /// Missing `Content-Type` header.
8    #[error("missing content-type header")]
9    MissingContentType,
10    /// `Content-Type` is present but not `application/foctet`.
11    #[error("invalid content-type: expected application/foctet")]
12    InvalidContentType,
13    /// Body sealing failed.
14    #[error("failed to seal HTTP body")]
15    SealFailed(#[source] BodyEnvelopeError),
16    /// Body opening failed.
17    #[error("failed to open HTTP body")]
18    OpenFailed(#[source] BodyEnvelopeError),
19}