Merge pull request #186 from de-vri-es/more-from-for-error

Implement From<CapacityError> and From<UrlError> for Error.
pull/192/head
Daniel Abramov 4 years ago committed by GitHub
commit e6fee89726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/error.rs

@ -48,7 +48,7 @@ pub enum Error {
/// - When writing: your message is bigger than the configured max message size /// - When writing: your message is bigger than the configured max message size
/// (64MB by default). /// (64MB by default).
#[error("Space limit exceeded: {0}")] #[error("Space limit exceeded: {0}")]
Capacity(CapacityError), Capacity(#[from] CapacityError),
/// Protocol violation. /// Protocol violation.
#[error("WebSocket protocol error: {0}")] #[error("WebSocket protocol error: {0}")]
Protocol(#[from] ProtocolError), Protocol(#[from] ProtocolError),
@ -60,7 +60,7 @@ pub enum Error {
Utf8, Utf8,
/// Invalid URL. /// Invalid URL.
#[error("URL error: {0}")] #[error("URL error: {0}")]
Url(UrlError), Url(#[from] UrlError),
/// HTTP error. /// HTTP error.
#[error("HTTP error: {}", .0.status())] #[error("HTTP error: {}", .0.status())]
Http(Response<Option<String>>), Http(Response<Option<String>>),

Loading…
Cancel
Save