Documentation ¶
Index ¶
- Variables
- func ByStatusCode(statusCode int) (error, bool)
- func GetAPIError(ctx context.Context, resp common.ResponseWrapper) error
- func IsMissing(err error) bool
- func MakeUnexpectedError(resp *http.Response, err error, requestBody, responseBody []byte) error
- type APIError
- type APIErrorBody
- type ErrorDetail
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadRequest = errors.New("the request is invalid") ErrUnauthenticated = errors.New("the request does not have valid authentication (AuthN) credentials for the operation") ErrPermissionDenied = errors.New("the caller does not have permission to execute the specified operation") ErrNotFound = errors.New("the operation was performed on a resource that does not exist") ErrResourceConflict = errors.New("maps to all HTTP 409 (Conflict) responses") ErrTooManyRequests = errors.New("maps to HTTP code: 429 Too Many Requests") ErrCancelled = errors.New("the operation was explicitly canceled by the caller") ErrInternalError = errors.New("some invariants expected by the underlying system have been broken") ErrNotImplemented = errors.New("the operation is not implemented or is not supported/enabled in this service") ErrDeadlineExceeded = errors.New("the deadline expired before the operation could complete") ErrInvalidParameterValue = inheritErr(ErrBadRequest, "supplied value for a parameter was invalid") ErrResourceDoesNotExist = inheritErr(ErrNotFound, "operation was performed on a resource that does not exist") ErrAborted = inheritErr(ErrResourceConflict, "the operation was aborted, typically due to a concurrency issue such as a sequencer check failure") ErrAlreadyExists = inheritErr(ErrResourceConflict, "operation was rejected due a conflict with an existing resource") ErrResourceAlreadyExists = inheritErr(ErrResourceConflict, "operation was rejected due a conflict with an existing resource") ErrResourceExhausted = inheritErr(ErrTooManyRequests, "operation is rejected due to per-user rate limiting") ErrRequestLimitExceeded = inheritErr(ErrTooManyRequests, "cluster request was rejected because it would exceed a resource limit") ErrUnknown = inheritErr(ErrInternalError, "this error is used as a fallback if the platform-side mapping is missing some reason") ErrDataLoss = inheritErr(ErrInternalError, "unrecoverable data loss or corruption") )
Functions ¶
func ByStatusCode ¶ added in v0.26.2
func GetAPIError ¶ added in v0.18.0
func GetAPIError(ctx context.Context, resp common.ResponseWrapper) error
GetAPIError inspects HTTP errors from the Databricks API for known transient errors.
Types ¶
type APIError ¶
type APIError struct { ErrorCode string Message string StatusCode int Details []ErrorDetail // contains filtered or unexported fields }
APIError is a generic struct for an api error on databricks
func GenericIOError ¶ added in v0.18.0
func TooManyRequests ¶ added in v0.18.0
func TooManyRequests() *APIError
func (*APIError) IsRetriable ¶
isRetriable returns true if error is retriable
func (*APIError) IsTooManyRequests ¶
IsTooManyRequests shows rate exceeded limits
type APIErrorBody ¶
type APIErrorBody struct { ErrorCode string `json:"error_code,omitempty"` Message string `json:"message,omitempty"` Details []ErrorDetail `json:"details,omitempty"` // The following two are for scim api only // for RFC 7644 Section 3.7.3 https://tools.ietf.org/html/rfc7644#section-3.7.3 ScimDetail string `json:"detail,omitempty"` ScimStatus string `json:"status,omitempty"` ScimType string `json:"scimType,omitempty"` API12Error string `json:"error,omitempty"` }
APIErrorBody maps "proper" databricks rest api errors to a struct
type ErrorDetail ¶ added in v0.20.0
type ErrorDetail struct { Type string `json:"@type,omitempty"` Reason string `json:"reason,omitempty"` Domain string `json:"domain,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` }
func GetErrorInfo ¶ added in v0.20.0
func GetErrorInfo(err error) []ErrorDetail
GetErrorInfo returns all entries in the list of error details of type `ErrorInfo`.
Click to show internal directories.
Click to hide internal directories.