Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions deepwell/src/error/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,11 @@ pub fn exn_error_to_rpc_error(exn_error: Exn<Error>) -> ErrorObjectOwned {
Some(TopError::CrateError(error)) => {
let error_code = error.code();
let message = error.summary();
let data = match error.error_type {
// Special case, if authentication then don't include call trace
// See comment in auth_login in endpoints/auth.rs
ErrorType::InvalidAuthentication => None,

// Normal case, provide error context
_ => Some(json!({
"call_trace": format!("{exn_error:?}"),
"code_trace": code_trace,
"extra": extra_data,
})),
};
let data = Some(json!({
"call_trace": format!("{exn_error:?}"),
"code_trace": code_trace,
"extra": extra_data,
}));
ErrorObjectOwned::owned(error_code, message, data)
}

Expand Down
Loading