Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
TEAS-577 [feat] add utf8 error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
untoldwind committed Dec 4, 2018
1 parent 8168027 commit 90b5fae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/problem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ impl From<std::time::SystemTimeError> for Problem {
}
}

impl From<std::str::Utf8Error> for Problem {
fn from(error: std::str::Utf8Error) -> Problem {
error!("UTF-8 error: {}", error);

Problem::bad_request().with_details(format!("UTF-8 error: {}", error))
}
}

impl From<actix_web::error::Error> for Problem {
fn from(error: actix_web::Error) -> Problem {
error!("Actix: {}", error);
Expand Down

0 comments on commit 90b5fae

Please sign in to comment.