From d12a92eac9e0b783d0373f8859e43178f6958938 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 31 Aug 2023 23:01:01 +0100 Subject: [PATCH] box: fix unhelpful decoding of error messages into decimal numbers Before this change the box backend could make errors like Error "not_found" (404): On-Behalf-Of User not found ([123 34 105 110 118 97 108 105 100 95 117 115 101 114 95 105 100 34 58 123 34 105 100 34 58 34 48 48 48 48 48 48 48 48 48 48 48 34 125 125]) This fixes it to produce this instead Error "not_found" (404): On-Behalf-Of User not found ({"invalid_user_id":{"id":"00000000000"}}) --- backend/box/api/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/box/api/types.go b/backend/box/api/types.go index f8e92638f..b96349903 100644 --- a/backend/box/api/types.go +++ b/backend/box/api/types.go @@ -52,7 +52,7 @@ func (e *Error) Error() string { out += ": " + e.Message } if e.ContextInfo != nil { - out += fmt.Sprintf(" (%+v)", e.ContextInfo) + out += fmt.Sprintf(" (%s)", string(e.ContextInfo)) } return out }