MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / from

Method from

examples/rocket_okapi_example/api/src/error.rs:102–116  ·  view source on GitHub ↗
(err: rocket::serde::json::Error)

Source from the content-addressed store, hash-verified

100
101impl From<rocket::serde::json::Error<'_>> for Error {
102 fn from(err: rocket::serde::json::Error) -> Self {
103 use rocket::serde::json::Error::*;
104 match err {
105 Io(io_error) => Error {
106 err: "IO Error".to_owned(),
107 msg: Some(io_error.to_string()),
108 http_status_code: 422,
109 },
110 Parse(_raw_data, parse_error) => Error {
111 err: "Parse Error".to_owned(),
112 msg: Some(parse_error.to_string()),
113 http_status_code: 422,
114 },
115 }
116 }
117}

Callers 8

upMethod · 0.45
upMethod · 0.45
upMethod · 0.45
upMethod · 0.45
upMethod · 0.45
upMethod · 0.45
defMethod · 0.45
defMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected