Skip to content

Commit 9441f7c

Browse files
Gal Topperpavius
authored andcommitted
Include full HTTP response in error. (#20)
1 parent ba51e53 commit 9441f7c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pkg/dataplane/http/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ func (c *context) sendRequest(dataPlaneInput *v3io.DataPlaneInput,
923923

924924
// make sure we got expected status
925925
if !success {
926-
err = v3ioerrors.NewErrorWithStatusCode(fmt.Errorf("Failed %s with status %d", method, statusCode), statusCode)
926+
err = v3ioerrors.NewErrorWithStatusCode(fmt.Errorf("Expected a 2xx response status code: %s", response.HTTPResponse.String()), statusCode)
927927
goto cleanup
928928
}
929929

pkg/errors/errors.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package v3ioerrors
22

33
import (
44
"errors"
5-
"fmt"
65
)
76

87
var ErrInvalidTypeConversion = errors.New("Invalid type conversion")
@@ -26,5 +25,5 @@ func (e ErrorWithStatusCode) StatusCode() int {
2625
}
2726

2827
func (e ErrorWithStatusCode) Error() string {
29-
return fmt.Sprintf("%s (%d response code)", e.error.Error(), e.statusCode)
28+
return e.error.Error()
3029
}

0 commit comments

Comments
 (0)