ErrorInfo
Centralized error information ready for internationalization.
The main export for this crate is the trait and derive macro ErrorInfo :
Then you should be able to retrieve error info:
let bad_request = BadRequest ;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Or collect every error declared in any crate (with summary feature enabled), which simplifies the error management for
web services:
let summary = summary;
write?
// Writes:
//
// [
// {
// "status": 400,
// "code": "BAD_REQUEST",
// "raw_message": "Bad request: {reason}",
// },
// {
// "status": 500,
// "code": "INTERNAL_SERVER_ERROR",
// "raw_message": "Internal server error",
// }
// ]
You can also export that data using your preferred localization format and share it with the frontend team.