Skip to main content

hyperlane_core/error/
enum.rs

1use super::*;
2
3/// Represents errors that can occur at the server level.
4#[derive(Clone, CustomDebug, Deserialize, DisplayDebug, Eq, PartialEq, Serialize)]
5pub enum ServerError {
6    /// An error occurred while trying to bind to a TCP socket.
7    TcpBind(String),
8    /// An error occurred while loading or configuring TLS material.
9    Tls(String),
10    /// HTTP/3 was selected without TLS, which the protocol requires.
11    MissingTlsForHttp3,
12    /// An unknown or unexpected error occurred.
13    Unknown(String),
14    /// An error occurred while reading an HTTP request.
15    HttpRead(String),
16    /// The received HTTP request was invalid or malformed.
17    InvalidHttpRequest(Request),
18    /// Other error.
19    Other(String),
20}
21
22/// Represents errors related to route definitions and matching.
23#[derive(Clone, CustomDebug, Deserialize, DisplayDebug, Eq, PartialEq, Serialize)]
24pub enum RouteError {
25    /// The route pattern cannot be empty.
26    EmptyPattern,
27    /// A route with the same pattern has already been defined.
28    DuplicatePattern(String),
29    /// The provided route pattern is not a valid regular expression.
30    InvalidRegexPattern(String),
31}