betfair_stream_api/
error.rs

1/// Errors that can occur in the stream processing module.
2#[expect(clippy::module_name_repetitions)]
3#[non_exhaustive]
4#[derive(Debug, thiserror::Error)]
5/// Represents errors that can occur in the stream processing module.
6pub enum StreamError {
7    /// Represents an I/O error.
8    #[error("IO Error {0}")]
9    IoError(#[from] std::io::Error),
10    /// Represents a JSON parsing error.
11    #[error("JSON Error {0}")]
12    JsonError(#[from] serde_json::Error),
13    /// Indicates that no data was received.
14    #[error("No data")]
15    NoData,
16    /// Indicates an unexpected response from the stream.
17    #[error("Unexpected response {0}")]
18    UnexpectedResponse(String),
19    /// Indicates that the connection ID is not present.
20    #[error("Connection ID not present")]
21    ConnectionIdNotPresent,
22    /// Indicates a misconfigured stream URL.
23    #[error("Misconfigured stream URL")]
24    MisconfiguredStreamURL,
25    /// Indicates a malfunction in the stream processor.
26    #[error("Stream processor malfunctioned")]
27    StreamProcessorMalfunction,
28    /// Indicates that the host string is not present in the stream URL.
29    #[error("Host string not present in the Stream URL")]
30    HostStringNotPresent,
31    /// Indicates an inability to look up the host.
32    #[error("Unable to look up host {host}:{port}")]
33    UnableToLookUpHost { host: String, port: u16 },
34    /// Indicates an inability to convert a domain to a server name.
35    #[error("Unable to convert domain to server name")]
36    UnableConvertDomainToServerName,
37    /// Indicates an inability to connect to a TLS stream.
38    #[error("Unable to connect to TLS stream")]
39    UnableConnectToTlsStream,
40    /// Indicates an inability to set the native certificate.
41    #[error("Unable to set native certificate")]
42    CannotSetNativeCertificate,
43    /// Indicates an inability to set a custom certificate.
44    #[error("Unable to set custom certificate")]
45    UnableToSetCustomCertificate,
46    /// Indicates that a custom certificate is not set.
47    #[error("Unable to set custom certificate")]
48    CustomCertificateNotSet,
49    /// Indicates that the custom certificate is invalid.
50    #[error("Invalid custom certificate")]
51    InvalidCustomCertificate,
52    /// Indicates an inability to load a local certificate.
53    #[error("Unable to load local certificate")]
54    LocalCertificateLoadError,
55}