Skip to content

Commit

Permalink
feat: more context in error string for response/multi-response.Failed
Browse files Browse the repository at this point in the history
  • Loading branch information
carlmontanari committed Aug 23, 2023
1 parent 3160566 commit 0f7144b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions response/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}

Expand All @@ -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,
)
}

Expand Down

0 comments on commit 0f7144b

Please sign in to comment.