From f597cb6c6db592fc338d6d41446748f201966f2e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 20 Jul 2018 15:06:11 -0700 Subject: format InvalidFatcatId errors in API response (hack) --- rust/src/api_wrappers.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/rust/src/api_wrappers.rs b/rust/src/api_wrappers.rs index e10906a8..bc1e61ef 100644 --- a/rust/src/api_wrappers.rs +++ b/rust/src/api_wrappers.rs @@ -33,7 +33,8 @@ macro_rules! wrap_entity_handlers { Err(Error(ErrorKind::Uuid(e), _)) => $get_resp::BadRequest(ErrorResponse { message: e.to_string() }), Err(Error(ErrorKind::InvalidFatcatId(e), _)) => - $get_resp::BadRequest(ErrorResponse { message: e.to_string() }), + $get_resp::BadRequest(ErrorResponse { + message: ErrorKind::InvalidFatcatId(e).to_string() }), Err(e) => { error!("{}", e); $get_resp::GenericError(ErrorResponse { message: e.to_string() }) @@ -55,7 +56,8 @@ macro_rules! wrap_entity_handlers { Err(Error(ErrorKind::Uuid(e), _)) => $post_resp::BadRequest(ErrorResponse { message: e.to_string() }), Err(Error(ErrorKind::InvalidFatcatId(e), _)) => - $post_resp::BadRequest(ErrorResponse { message: e.to_string() }), + $post_resp::BadRequest(ErrorResponse { + message: ErrorKind::InvalidFatcatId(e).to_string() }), Err(e) => { error!("{}", e); $post_resp::GenericError(ErrorResponse { message: e.to_string() }) @@ -77,7 +79,8 @@ macro_rules! wrap_entity_handlers { Err(Error(ErrorKind::Uuid(e), _)) => $post_batch_resp::BadRequest(ErrorResponse { message: e.to_string() }), Err(Error(ErrorKind::InvalidFatcatId(e), _)) => - $post_batch_resp::BadRequest(ErrorResponse { message: e.to_string() }), + $post_batch_resp::BadRequest(ErrorResponse { + message: ErrorKind::InvalidFatcatId(e).to_string() }), Err(e) => { error!("{}", e); $post_batch_resp::GenericError(ErrorResponse { message: e.to_string() }) @@ -100,7 +103,8 @@ macro_rules! wrap_entity_handlers { Err(Error(ErrorKind::Uuid(e), _)) => $get_history_resp::BadRequest(ErrorResponse { message: e.to_string() }), Err(Error(ErrorKind::InvalidFatcatId(e), _)) => - $get_history_resp::BadRequest(ErrorResponse { message: e.to_string() }), + $get_history_resp::BadRequest(ErrorResponse { + message: ErrorKind::InvalidFatcatId(e).to_string() }), Err(e) => { error!("{}", e); $get_history_resp::GenericError(ErrorResponse { message: e.to_string() }) -- cgit v1.2.3