errors

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The request failed validation rules.
	// This occurs when input does not satisfy
	// schema, format, or business validation constraints.
	ErrValidation error = errors.New("validation failed")

	// The request is malformed and cannot be parsed.
	// This typically indicates invalid syntax, corrupted
	// payloads, or malformed request structures.
	ErrMalformed error = errors.New("malformed request")

	// The client is not authenticated.
	// This occurs when authentication is required but
	// credentials are missing, invalid, or expired.
	ErrUnauthenticated error = errors.New("unauthenticated")

	// The client is authenticated but lacks sufficient
	// permissions to access the requested resource.
	ErrPermissionDenied error = errors.New("permission denied")

	// The requested resource does not exist.
	// This indicates that the target entity could not
	// be found or is unavailable.
	ErrNotFound error = errors.New("resource not found")

	// The resource already exists.
	// This occurs when attempting to create a resource
	// that conflicts with an existing unique entity.
	ErrAlreadyExists error = errors.New("resource already exists")

	// The operation conflicts with the current state
	// of the resource or system.
	ErrConflict error = errors.New("conflict detected")

	// The operation cannot be completed because a required
	// precondition was not met.
	// For example, missing dependencies or invalid state.
	ErrFailedPrecondition error = errors.New("precondition failed")

	// The system has exhausted available resources.
	// For example, memory, storage, quotas, or concurrency limits.
	ErrResourceExhausted error = errors.New("resource exhausted")

	// The operation timed out before completion.
	// This may happen due to slow downstream systems
	// or exceeded execution deadlines.
	ErrDeadlineExceeded error = errors.New("deadline exceeded")

	// The operation was canceled before completion.
	// This usually happens because the caller canceled
	// the request or context.
	ErrCanceled error = errors.New("request canceled")

	// The service or dependency is temporarily unavailable.
	// This may occur during maintenance, overload,
	// or dependency failures.
	ErrUnavailable error = errors.New("service unavailable")

	// The operation was aborted due to concurrency conflicts,
	// transaction rollbacks, or race conditions.
	ErrAborted error = errors.New("operation aborted")

	// An unexpected internal error occurred.
	// This usually indicates a bug, misconfiguration,
	// or unexpected runtime condition.
	ErrInternal error = errors.New("internal server error")
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Type error
	Err  error
	Code string
}

func New

func New(err error, message string, code string) Error

func (Error) Error

func (e Error) Error() string

func (Error) GetCode

func (e Error) GetCode() string

func (Error) Unwrap

func (e Error) Unwrap() error

Jump to

Keyboard shortcuts

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