mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2024-12-11 09:22:55 +01:00
Change error response to be closer to upstream
This commit is contained in:
parent
f2078a3849
commit
ce4fedf191
1 changed files with 8 additions and 7 deletions
15
src/util.rs
15
src/util.rs
|
@ -6,17 +6,18 @@ macro_rules! err {
|
|||
($err:expr, $msg:expr) => {{
|
||||
println!("ERROR: {}", $msg);
|
||||
err_json!(json!({
|
||||
"Message": $err,
|
||||
"ValidationErrors": {
|
||||
"": [$msg,],
|
||||
},
|
||||
"error": $err,
|
||||
"error_description": $err,
|
||||
"ErrorModel": {
|
||||
"Message": $msg,
|
||||
"ValidationErrors": null,
|
||||
"ExceptionMessage": null,
|
||||
"ExceptionStackTrace": null,
|
||||
"InnerExceptionMessage": null,
|
||||
"Object": "error",
|
||||
}))
|
||||
"Object": "error"
|
||||
}}))
|
||||
}};
|
||||
($msg:expr) => { err!("The model state is invalid", $msg) }
|
||||
($msg:expr) => { err!("unknown_error", $msg) }
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
|
|
Loading…
Reference in a new issue