vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

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:
Msrc/util.rs | 19++++++++++---------
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]