mirror of
https://github.com/rclone/rclone.git
synced 2024-12-05 23:01:09 +01:00
26 lines
469 B
Go
26 lines
469 B
Go
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,
|
|
)
|
|
}
|