forked from TrueCloudLab/rclone
vendor: add github.com/putdotio/go-putio for putio client
This commit is contained in:
parent
8159658e67
commit
566aa0fca7
15 changed files with 1315 additions and 0 deletions
25
vendor/github.com/putdotio/go-putio/putio/error.go
generated
vendored
Normal file
25
vendor/github.com/putdotio/go-putio/putio/error.go
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
package putio
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ErrorResponse reports the error caused by an API request.
|
||||
type ErrorResponse struct {
|
||||
Response *http.Response `json:"-"`
|
||||
|
||||
Message string `json:"error_message"`
|
||||
Type string `json:"error_type"`
|
||||
}
|
||||
|
||||
func (e *ErrorResponse) Error() string {
|
||||
return fmt.Sprintf(
|
||||
"Type: %v Message: %q. Original error: %v %v: %v",
|
||||
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