commit b3f3fd81aca91b0d14b71b5a3feea1cf298436cc
parent 3d1fc0f2e8027f729e7581b8112f0137d5216cd8
Author: Miroslav Prasil <miroslav@prasil.info>
Date: Wed, 15 Aug 2018 15:50:07 +0100
Update theerror 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]