pub type HttpCertificationResult<T = ()> = Result<T, HttpCertificationError>;
#[derive(thiserror::Error, Debug, Clone)]
pub enum HttpCertificationError {
#[error(r#"Failed to parse url: "{0}""#)]
MalformedUrl(String),
#[error(r#"Error converting UTF8 string bytes: "{0}""#)]
Utf8ConversionError(#[from] std::string::FromUtf8Error),
#[error(r#"Wildcard path "{wildcard_path}" is too specific for request path "{request_path}", use a less specific wildcard path"#)]
WildcardPathNotValidForRequestPath {
wildcard_path: String,
request_path: String,
},
#[error(r#"The IC-CertificateExpression header in the response did not match the Cel expression used to certify the response. Expected: "{expected}", Actual: "{actual}""#)]
CertificateExpressionHeaderMismatch {
expected: String,
actual: String,
},
#[error(r#"The IC-CertificateExpression header was missing from the response. Expected: "{expected}""#)]
CertificateExpressionHeaderMissing {
expected: String,
},
#[error(r#"The IC-CertificateExpression header in the response contained multiple values. Expected only one: "{expected}""#)]
MultipleCertificateExpressionHeaders {
expected: String,
},
#[error(r#"Error converting number into HTTP status code: "{status_code}""#)]
InvalidHttpStatusCode {
status_code: u16,
},
}