Documentation ¶
Index ¶
- Constants
- func HTTPErrorFromGrpcError(err error) int
- func IsStatusLimit(err error, label string) bool
- func IsTransient(err error) bool
- func JSONWithHTTPStatus(statusCode int, message string) string
- func NewB2CErrorHandler(fallback runtime.ErrorHandlerFunc) runtime.ErrorHandlerFunc
- func NewHTTPErrorHandler(fallback runtime.ErrorHandlerFunc) runtime.ErrorHandlerFunc
- func NewTransientError(err error) error
- func NewTransientErrorf(format string, a ...any) error
- func SetQuotaReached(ctx context.Context, tenantID string, name string) error
- func SetQuotaUnknown(ctx context.Context, tenantID string, name string, err error) error
- func StatusError(ctx context.Context, c codes.Code, fmt string, opts ...any) error
- type ErrB2C
- type ErrorWithStatus
- type HTTPError
- type Logger
- type Status
Constants ¶
const ( QuotaReached = "QuotaReached" QuotaUnknown = "QuotaUnknown" )
Variables ¶
This section is empty.
Functions ¶
func HTTPErrorFromGrpcError ¶
func IsStatusLimit ¶
func IsTransient ¶
IsTransient returns true if the error was wrapped to indicate its transient. If this function returns true it is safe, but not required, to retry the operation.
func JSONWithHTTPStatus ¶
func NewB2CErrorHandler ¶
func NewB2CErrorHandler(fallback runtime.ErrorHandlerFunc) runtime.ErrorHandlerFunc
NewB2CErrorHandler returns a handler for Azure format b2c errors.
return a json response in the format defined here: https://docs.microsoft.com/en-us/azure/active-directory-b2c/restful-technical-profile#returning-validation-error-message
func NewHTTPErrorHandler ¶
func NewHTTPErrorHandler(fallback runtime.ErrorHandlerFunc) runtime.ErrorHandlerFunc
func NewTransientError ¶
NewTransientError creates an Error object that indicates a retry is appropriate. It is up to the consumer to decide whether to retry based on the context of that consumer. Note that crashing out is effectively a retry unless the message is explicitly Completed or DeadLettered first.
func NewTransientErrorf ¶
func SetQuotaReached ¶
SetQuotaReached returns a labelled QuotaReached error
func SetQuotaUnknown ¶
SetQuotaUnknown returns a labelled QuotaUnknown error
Types ¶
type ErrB2C ¶
type ErrB2C struct { // APIVersion is the API version of b2c that we are using APIVersion string `json:"version"` // Status, http status code. The REST API should return an HTTP 4xx error message Status int `json:"status"` // UserMessage is the message to the user UserMessage string `json:"userMessage"` }
type ErrorWithStatus ¶
type ErrorWithStatus struct {
// contains filtered or unexported fields
}
func NewErrorStatus ¶
func NewErrorStatus(err error, statusCode int) *ErrorWithStatus
func (*ErrorWithStatus) Error ¶
func (e *ErrorWithStatus) Error() string
func (*ErrorWithStatus) StatusCode ¶
func (e *ErrorWithStatus) StatusCode() int
func (*ErrorWithStatus) Unwrap ¶
func (e *ErrorWithStatus) Unwrap() error