commit 6fdeeb56ce2361aac89aca7a69d9c9177b764254
parent b002d34cd47813be5e99df1b0bb1d1db2c5f1ff0
Author: Daniel GarcĂa <dani-garcia@users.noreply.github.com>
Date: Thu, 16 Aug 2018 00:52:46 +0200
Merge pull request #140 from mprasil/error_format
Update the error format to show message in new Vault
Diffstat:
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/util.rs b/src/util.rs
@@ -3,19 +3,20 @@
///
#[macro_export]
macro_rules! err {
- ($err:expr, $err_desc:expr, $msg:expr) => {{
+ ($err:expr, $msg:expr) => {{
println!("ERROR: {}", $msg);
err_json!(json!({
- "error": $err,
- "error_description": $err_desc,
- "ErrorModel": {
- "Message": $msg,
- "ValidationErrors": null,
- "Object": "error"
- }
+ "Message": $err,
+ "ValidationErrors": {
+ "": [$msg,],
+ },
+ "ExceptionMessage": null,
+ "ExceptionStackTrace": null,
+ "InnerExceptionMessage": null,
+ "Object": "error",
}))
}};
- ($msg:expr) => { err!("default_error", "default_error_description", $msg) }
+ ($msg:expr) => { err!("The model state is invalid", $msg) }
}
#[macro_export]