Skip to content

Commit

Permalink
Include full HTTP response in error. (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gal Topper authored and pavius committed Jun 6, 2019
1 parent ba51e53 commit 9441f7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/dataplane/http/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ func (c *context) sendRequest(dataPlaneInput *v3io.DataPlaneInput,

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

Expand Down
3 changes: 1 addition & 2 deletions pkg/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package v3ioerrors

import (
"errors"
"fmt"
)

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

func (e ErrorWithStatusCode) Error() string {
return fmt.Sprintf("%s (%d response code)", e.error.Error(), e.statusCode)
return e.error.Error()
}

0 comments on commit 9441f7c

Please sign in to comment.