// Code generated by internal codegen utility; DO NOT EDIT. package core import ( "fmt" "net/http" ) // HTTPError is returned for a non-2xx HTTP response. type HTTPError struct { StatusCode int Header http.Header Body []byte } func (e *HTTPError) Error() string { status := fmt.Sprintf("HTTP %d", e.StatusCode) if statusText := http.StatusText(e.StatusCode); statusText != "" { status += " " + statusText } if len(e.Body) == 0 { return status } return status + ": " + string(e.Body) } // BackendError is returned when the backend reports an error in an otherwise // successful HTTP response. type BackendError struct { Code int64 Message string } func (e *BackendError) Error() string { return fmt.Sprintf("code: %v, message: %v", e.Code, e.Message) }