From 0f7144b04314d35036e67415c2c104d77d445a5c Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Wed, 23 Aug 2023 12:38:40 -0700 Subject: [PATCH] feat: more context in error string for response/multi-response.Failed --- response/errors.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/response/errors.go b/response/errors.go index 486949c..c12a031 100644 --- a/response/errors.go +++ b/response/errors.go @@ -15,9 +15,10 @@ type OperationError struct { // Error returns an error string for the OperationError object. func (e *OperationError) Error() string { return fmt.Sprintf( - "operation error from input '%s'. indicated error '%s'", + "operation error from input '%s'. indicated error '%s'. full output: '%s'", e.Input, e.ErrorString, + e.Output, ) } @@ -30,9 +31,10 @@ type MultiOperationError struct { func (e *MultiOperationError) Error() string { if len(e.Operations) == 1 { return fmt.Sprintf( - "operation error from input '%s'. indicated error '%s'", + "operation error from input '%s'. indicated error '%s'. full output: '%s'", e.Operations[0].Input, e.Operations[0].ErrorString, + e.Operations[0].Output, ) }