From ba9950d81ca45975636eba81270e23a0c432e398 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 14 May 2021 16:50:33 +0100 Subject: [PATCH] impl error for handshakeerror --- actix-http/src/error.rs | 1 + actix-http/src/ws/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/actix-http/src/error.rs b/actix-http/src/error.rs index 92efd572d..203656bdd 100644 --- a/actix-http/src/error.rs +++ b/actix-http/src/error.rs @@ -44,6 +44,7 @@ impl Error { } /// Errors that can generate responses. +// TODO: add std::error::Error bound when replacement for Box is found pub trait ResponseError: fmt::Debug + fmt::Display { /// Returns appropriate status code for error. /// diff --git a/actix-http/src/ws/mod.rs b/actix-http/src/ws/mod.rs index 22df2b4ff..3571bb379 100644 --- a/actix-http/src/ws/mod.rs +++ b/actix-http/src/ws/mod.rs @@ -25,7 +25,7 @@ pub use self::frame::Parser; pub use self::proto::{hash_key, CloseCode, CloseReason, OpCode}; /// WebSocket protocol errors. -#[derive(Debug, Display, From, Error)] +#[derive(Debug, Display, Error, From)] pub enum ProtocolError { /// Received an unmasked frame from client. #[display(fmt = "Received an unmasked frame from client.")] @@ -71,7 +71,7 @@ pub enum ProtocolError { impl ResponseError for ProtocolError {} /// WebSocket handshake errors -#[derive(PartialEq, Debug, Display)] +#[derive(Debug, PartialEq, Display, Error)] pub enum HandshakeError { /// Only get method is allowed. #[display(fmt = "Method not allowed.")]