1
0
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:
Nikolay Kim
2019-11-26 16:07:39 +06:00
parent 4dc31aac93
commit f73f97353b
11 changed files with 105 additions and 111 deletions

View File

@ -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())
}