2016-11-13 23:34:36 +01:00

28 lines
437 B
Go

package oneandone
import (
"fmt"
)
type errorResponse struct {
Type string `json:"type"`
Message string `json:"message"`
}
type apiError struct {
httpStatusCode int
message string
}
func (e apiError) Error() string {
return fmt.Sprintf("%d - %s", e.httpStatusCode, e.message)
}
func (e *apiError) HttpStatusCode() int {
return e.httpStatusCode
}
func (e *apiError) Message() string {
return e.message
}