mirror of https://github.com/fafhrd91/actix-web
impl error for handshakeerror
This commit is contained in:
parent
2a8c650f2c
commit
ba9950d81c
|
@ -44,6 +44,7 @@ impl Error {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Errors that can generate responses.
|
/// Errors that can generate responses.
|
||||||
|
// TODO: add std::error::Error bound when replacement for Box<dyn Error> is found
|
||||||
pub trait ResponseError: fmt::Debug + fmt::Display {
|
pub trait ResponseError: fmt::Debug + fmt::Display {
|
||||||
/// Returns appropriate status code for error.
|
/// Returns appropriate status code for error.
|
||||||
///
|
///
|
||||||
|
|
|
@ -25,7 +25,7 @@ pub use self::frame::Parser;
|
||||||
pub use self::proto::{hash_key, CloseCode, CloseReason, OpCode};
|
pub use self::proto::{hash_key, CloseCode, CloseReason, OpCode};
|
||||||
|
|
||||||
/// WebSocket protocol errors.
|
/// WebSocket protocol errors.
|
||||||
#[derive(Debug, Display, From, Error)]
|
#[derive(Debug, Display, Error, From)]
|
||||||
pub enum ProtocolError {
|
pub enum ProtocolError {
|
||||||
/// Received an unmasked frame from client.
|
/// Received an unmasked frame from client.
|
||||||
#[display(fmt = "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 {}
|
impl ResponseError for ProtocolError {}
|
||||||
|
|
||||||
/// WebSocket handshake errors
|
/// WebSocket handshake errors
|
||||||
#[derive(PartialEq, Debug, Display)]
|
#[derive(Debug, PartialEq, Display, Error)]
|
||||||
pub enum HandshakeError {
|
pub enum HandshakeError {
|
||||||
/// Only get method is allowed.
|
/// Only get method is allowed.
|
||||||
#[display(fmt = "Method not allowed.")]
|
#[display(fmt = "Method not allowed.")]
|
||||||
|
|
Loading…
Reference in New Issue