mirror of
https://github.com/mikedilger/chorus.git
synced 2026-02-02 06:25:12 +00:00
alpha sort of Error variants
This commit is contained in:
parent
48b08e93f5
commit
918ed3fcb5
20
src/error.rs
20
src/error.rs
@ -131,12 +131,6 @@ pub enum ChorusError {
|
||||
// Rustls
|
||||
Rustls(tokio_rustls::rustls::Error),
|
||||
|
||||
// Timed Out
|
||||
TimedOut,
|
||||
|
||||
// Tungstenite
|
||||
Tungstenite(hyper_tungstenite::tungstenite::error::Error),
|
||||
|
||||
// Filter is underspecified
|
||||
Scraper,
|
||||
|
||||
@ -146,9 +140,15 @@ pub enum ChorusError {
|
||||
// Speedy
|
||||
Speedy(speedy::Error),
|
||||
|
||||
// Timed Out
|
||||
TimedOut,
|
||||
|
||||
// Too many subscriptions
|
||||
TooManySubscriptions,
|
||||
|
||||
// Tungstenite
|
||||
Tungstenite(hyper_tungstenite::tungstenite::error::Error),
|
||||
|
||||
// URL Parse
|
||||
UrlParse(url::ParseError),
|
||||
|
||||
@ -203,12 +203,12 @@ impl std::fmt::Display for ChorusError {
|
||||
ChorusError::RealIpHeaderMissing => write!(f, "X-Real-Ip header is missing"),
|
||||
ChorusError::Restricted => write!(f, "Restricted"),
|
||||
ChorusError::Rustls(e) => write!(f, "{e}"),
|
||||
ChorusError::TimedOut => write!(f, "Timed out"),
|
||||
ChorusError::Tungstenite(e) => write!(f, "{e}"),
|
||||
ChorusError::Scraper => write!(f, "Filter is underspecified. Scrapers are not allowed"),
|
||||
ChorusError::SerdeJson(e) => write!(f, "{e}"),
|
||||
ChorusError::Speedy(e) => write!(f, "{e}"),
|
||||
ChorusError::TimedOut => write!(f, "Timed out"),
|
||||
ChorusError::TooManySubscriptions => write!(f, "Too many subscriptions"),
|
||||
ChorusError::Tungstenite(e) => write!(f, "{e}"),
|
||||
ChorusError::UrlParse(e) => write!(f, "{e}"),
|
||||
ChorusError::Utf8(e) => write!(f, "{e}"),
|
||||
ChorusError::Utf8Error => write!(f, "UTF-8 error"),
|
||||
@ -290,12 +290,12 @@ impl ChorusError {
|
||||
ChorusError::RealIpHeaderMissing => 0.0,
|
||||
ChorusError::Restricted => 0.1,
|
||||
ChorusError::Rustls(_) => 0.0,
|
||||
ChorusError::TimedOut => 0.1,
|
||||
ChorusError::Tungstenite(_) => 0.0,
|
||||
ChorusError::Scraper => 0.4,
|
||||
ChorusError::SerdeJson(_) => 0.0,
|
||||
ChorusError::Speedy(_) => 0.0,
|
||||
ChorusError::TimedOut => 0.1,
|
||||
ChorusError::TooManySubscriptions => 0.1,
|
||||
ChorusError::Tungstenite(_) => 0.0,
|
||||
ChorusError::UrlParse(_) => 0.1,
|
||||
ChorusError::Utf8(_) => 0.1,
|
||||
ChorusError::Utf8Error => 0.1,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user