apierr

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 9 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForRetry

func CheckForRetry(ctx context.Context, resp *http.Response, respErr error, body []byte, bodyErr error) (bool, error)

CheckForRetry inspects HTTP errors from the Databricks API for known transient errors on Workspace creation

func IsMissing

func IsMissing(err error) bool

IsMissing tells if error is about missing resource

Types

type APIError

type APIError struct {
	ErrorCode  string
	Message    string
	StatusCode int
}

APIError is a generic struct for an api error on databricks

func NotFound

func NotFound(message string) *APIError

NotFound returns properly formatted Not Found error

func (*APIError) Error

func (apiError *APIError) Error() string

Error returns error message string instead of

func (*APIError) IsMissing

func (apiError *APIError) IsMissing() bool

IsMissing tells if it is missing resource

func (*APIError) IsRetriable

func (apiError *APIError) IsRetriable() bool

IsRetriable returns true if error is retriable

func (*APIError) IsTooManyRequests

func (apiError *APIError) IsTooManyRequests() bool

IsTooManyRequests shows rate exceeded limits

type APIErrorBody

type APIErrorBody struct {
	ErrorCode string `json:"error_code,omitempty"`
	Message   string `json:"message,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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL