forked from TrueCloudLab/rclone
vendor: update all dependencies
This commit is contained in:
parent
17b4058ee9
commit
abb9f89f65
443 changed files with 32118 additions and 18237 deletions
16
vendor/github.com/putdotio/go-putio/putio/error.go
generated
vendored
16
vendor/github.com/putdotio/go-putio/putio/error.go
generated
vendored
|
@ -7,19 +7,31 @@ import (
|
|||
|
||||
// ErrorResponse reports the error caused by an API request.
|
||||
type ErrorResponse struct {
|
||||
// Original http.Response
|
||||
Response *http.Response `json:"-"`
|
||||
|
||||
// Body read from Response
|
||||
Body []byte `json:"-"`
|
||||
|
||||
// Error while parsing the response
|
||||
ParseError error
|
||||
|
||||
// These fileds are parsed from response if JSON.
|
||||
Message string `json:"error_message"`
|
||||
Type string `json:"error_type"`
|
||||
}
|
||||
|
||||
func (e *ErrorResponse) Error() string {
|
||||
if e.ParseError != nil {
|
||||
return fmt.Errorf("cannot parse response. code:%d error:%q body:%q",
|
||||
e.Response.StatusCode, e.ParseError.Error(), string(e.Body[:250])).Error()
|
||||
}
|
||||
return fmt.Sprintf(
|
||||
"Type: %v Message: %q. Original error: %v %v: %v",
|
||||
"putio error. code:%d type:%q message:%q request:%v %v",
|
||||
e.Response.StatusCode,
|
||||
e.Type,
|
||||
e.Message,
|
||||
e.Response.Request.Method,
|
||||
e.Response.Request.URL,
|
||||
e.Response.Status,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue