workos_errors

package
v4.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBadRequest

func IsBadRequest(err error) bool

func TryGetHTTPError

func TryGetHTTPError(r *http.Response) error

TryGetHTTPError returns an error when the http response contains invalid status code.

Types

type ErrorWithMessage added in v4.21.0

type ErrorWithMessage struct {
	Message string `json:"message"`
}

ErrorWithMessage struct to hold a single error with a message

type FieldError

type FieldError struct {
	Field string
	Code  string
}

type HTTPError

type HTTPError struct {
	Code        int
	Status      string
	RequestID   string
	Message     string
	ErrorCode   string
	Errors      []string
	FieldErrors []FieldError
}

HTTPError represents an http error.

func (HTTPError) Error

func (e HTTPError) Error() string

type ResponseErrors added in v4.21.0

type ResponseErrors []string

ResponseErrors is a custom type that can handle unmarshaling []string or []ErrorWithMessage

func (*ResponseErrors) UnmarshalJSON added in v4.21.0

func (e *ResponseErrors) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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