diff options
author | leo60228 <leo@60228.dev> | 2020-05-25 09:03:28 -0400 |
---|---|---|
committer | Paul Woolcock <paul@woolcock.us> | 2020-06-08 14:46:16 -0400 |
commit | 791bc83387bbac4fb6ff46f4cf1153e37837b626 (patch) | |
tree | f95471d37512506d858ba72eb4929b76a540ba69 /src/errors.rs | |
parent | b877d7983116661a60de815aa0a22762847cbe78 (diff) |
Use WebSockets for events
Diffstat (limited to 'src/errors.rs')
-rw-r--r-- | src/errors.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs index b48cb0c..65e5fcc 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -12,6 +12,8 @@ use tomlcrate::de::Error as TomlDeError; #[cfg(feature = "toml")] use tomlcrate::ser::Error as TomlSerError; use url::ParseError as UrlError; +use url1x::ParseError as ReqwestUrlError; +use tungstenite::error::Error as WebSocketError; /// Convience type over `std::result::Result` with `Error` as the error type. pub type Result<T> = ::std::result::Result<T, Error>; @@ -33,6 +35,8 @@ pub enum Error { Io(IoError), /// Wrapper around the `url::ParseError` struct. Url(UrlError), + /// Wrapper around the `url::ParseError` struct. + ReqwestUrl(ReqwestUrlError), /// Missing Client Id. ClientIdRequired, /// Missing Client Secret. @@ -60,6 +64,8 @@ pub enum Error { Envy(EnvyError), /// Error serializing to a query string SerdeQs(SerdeQsError), + /// WebSocket error + WebSocket(WebSocketError), /// Other errors Other(String), } @@ -79,6 +85,7 @@ impl error::Error for Error { Error::Http(ref e) => e, Error::Io(ref e) => e, Error::Url(ref e) => e, + Error::ReqwestUrl(ref e) => e, #[cfg(feature = "toml")] Error::TomlSer(ref e) => e, #[cfg(feature = "toml")] @@ -88,6 +95,7 @@ impl error::Error for Error { #[cfg(feature = "env")] Error::Envy(ref e) => e, Error::SerdeQs(ref e) => e, + Error::WebSocket(ref e) => e, Error::Client(..) | Error::Server(..) => { return None @@ -138,6 +146,7 @@ from! { SerdeError, Serde, UrlEncodedError, UrlEncoded, UrlError, Url, + ReqwestUrlError, ReqwestUrl, ApiError, Api, #[cfg(feature = "toml")] TomlSerError, TomlSer, #[cfg(feature = "toml")] TomlDeError, TomlDe, @@ -145,6 +154,7 @@ from! { HeaderParseError, HeaderParseError, #[cfg(feature = "env")] EnvyError, Envy, SerdeQsError, SerdeQs, + WebSocketError, WebSocket, String, Other, } |