Documentation
¶
Index ¶
- func IsAccessForbiddenError(err error) bool
- func IsBadRequestError(err error) bool
- func IsCertificateHostnameError(err error) bool
- func IsCertificateInvalidError(err error) bool
- func IsCertificateSignedByUnknownAuthorityError(err error) bool
- func IsConflictError(err error) bool
- func IsInternalServerError(err error) bool
- func IsMalformedResponse(err error) bool
- func IsNotFoundError(err error) bool
- func IsServiceUnavailableError(err error) bool
- func IsUnauthorizedError(err error) bool
- type APIError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAccessForbiddenError ¶
IsAccessForbiddenError checks whether the error is an HTTP 403 error.
func IsBadRequestError ¶
IsBadRequestError checks whether the error is an HTTP 400 error.
func IsCertificateHostnameError ¶
IsCertificateHostnameError checks whether the error represents a x509.HostnameError
func IsCertificateInvalidError ¶
IsCertificateInvalidError checks whether the error represents a x509.UnknownAuthorityError
func IsCertificateSignedByUnknownAuthorityError ¶
IsCertificateSignedByUnknownAuthorityError checks whether the error represents a x509.UnknownAuthorityError
func IsConflictError ¶
IsConflictError checks whether the error is an HTTP 409 error.
func IsInternalServerError ¶
IsInternalServerError checks whether the error is an HTTP 500 error.
func IsMalformedResponse ¶
IsMalformedResponse checks whether the error is "Malformed response", which can mean several things.
func IsNotFoundError ¶
IsNotFoundError checks whether the error is an HTTP 404 error.
func IsServiceUnavailableError ¶
IsServiceUnavailableError checks whether the error is an HTTP 503 error.
func IsUnauthorizedError ¶
IsUnauthorizedError checks whether the error is an HTTP 401 error.
Types ¶
type APIError ¶
type APIError struct {
// HTTPStatusCode holds the HTTP response status code, if there was any.
HTTPStatusCode int
// OriginalError is the original error object which should contain
// type-specific details.
OriginalError error
// ErrorMessage is a short, user-friendly error message we generate for
// presenting details to the end user.
ErrorMessage string
// ErrorDetails is a longer text we MAY set additionally to help the user
// understand and maybe solve the problem.
ErrorDetails string
// URL is the URL called with the request.
URL string
// HTTPMethod is the HTTP method used.
HTTPMethod string
// IsTimeout will be true if our error was a timeout error.
IsTimeout bool
// IsTemporary will be true if we think that a retry will help.
IsTemporary bool
}
APIError is our structure to carry all error information we care about from the api client to the CLI.