commit ce4fedf1913c83a3a5b2e6ce5b056e4756be5dd7
parent f2078a38496b872c631e394d2f783a32ee2775b4
Author: Daniel GarcĂa <dani-garcia@users.noreply.github.com>
Date: Wed, 10 Oct 2018 20:37:04 +0200
Change error response to be closer to upstream
Diffstat:
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/util.rs b/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]