errors

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STAGE_BEFORE_REQUEST = "before-request"
	STAGE_REQUEST        = "request"
	STAGE_AFTER_REQUEST  = "after-request"

	TYPE_UNKNOWN         = "unknown"
	TYPE_NOT_IMPLEMENTED = "not-implemented"
	TYPE_JSON_PARSE      = "json"
	TYPE_REQUEST_PREP    = "request-prep"
	TYPE_IO              = "io"
	TYPE_HTTP_STATUS     = "not-ok-http-status"
	TYPE_INVALID_DATA    = "invalid-data"

	ITERABLE_NoUserWithIdExists      = "error.users.noUserWithIdExists"
	ITERABLE_InvalidList             = "error.lists.invalidListId"
	ITERABLE_Success                 = "Success"
	ITERABLE_FieldTypeMismatchErrStr = "RequestFieldsTypesMismatched"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	Stage          string
	Type           string
	SourceErr      error
	Body           []byte
	HttpStatusCode int

	IterableCode string
}

func (*ApiError) Error

func (e *ApiError) Error() string

func (*ApiError) Is added in v0.2.0

func (e *ApiError) Is(other error) bool

Is method is required by errors.Is() to properly distinguish between different types -vs- same pointer to the same type. Without it, errors.Is(err, ErrFieldTypeMismatch) returns false: ok := errors.Is(errors.Join(&iterable_errors.ApiError{}), &iterable_errors.ApiError{}) ^ would be false

Jump to

Keyboard shortcuts

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