Implement From<CapacityError> and From<UrlError> for Error.

pull/186/head
Maarten de Vries 4 years ago
parent 3721ca8d0b
commit abebb330af
  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