From 12557cbdb5dee2d72b83514f390911e89fc6b172 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 10 Jan 2019 16:10:06 -0800 Subject: return error enum variant name (only) --- rust/src/errors.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rust') diff --git a/rust/src/errors.rs b/rust/src/errors.rs index 95979534..19ba2f82 100644 --- a/rust/src/errors.rs +++ b/rust/src/errors.rs @@ -106,7 +106,8 @@ impl Into for FatcatError { // TODO: something more complex? context? models::ErrorResponse { success: false, - error: self.name().unwrap_or("other").to_string(), + // enum variant name, without fields. whew, what a pile + error: format!("{:?}", self).split('(').collect::>()[0].to_string(), message: self.to_string(), } } -- cgit v1.2.3