mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 10:27:42 +02:00
refactor ResponseError trait
This commit is contained in:
@ -93,6 +93,10 @@ pub enum CorsError {
|
||||
}
|
||||
|
||||
impl ResponseError for CorsError {
|
||||
fn status_code(&self) -> StatusCode {
|
||||
StatusCode::BAD_REQUEST
|
||||
}
|
||||
|
||||
fn error_response(&self) -> HttpResponse {
|
||||
HttpResponse::with_body(StatusCode::BAD_REQUEST, format!("{}", self).into())
|
||||
}
|
||||
|
Reference in New Issue
Block a user