errorutil

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conflict

func Conflict(format string, args ...any) error

Conflict creates a new conflict error with a given error message.

func ConnectErrorComparer

func ConnectErrorComparer() cmp.Option

func Convert

func Convert(err error) *connect.Error

Convert compares the error and maps it to a appropriate connect.Error if there is no backend-specific wrapped error given to this function, it will just return an internal error. if there are multiple errors wrapped this function only cares about the first found error in the error tree.

func FailedPrecondition added in v0.0.6

func FailedPrecondition(format string, args ...any) error

FailedPrecondition creates a new FailedPrecondition error with a given error message and the original error.

func Internal

func Internal(format string, args ...any) error

Internal creates a new Internal error with a given error message and the original error.

func InvalidArgument

func InvalidArgument(format string, args ...any) error

InvalidArgument creates a new InvalidArgument error with a given error message and the original error.

func IsConflict

func IsConflict(err error) bool

func IsFailedPrecondition added in v0.0.6

func IsFailedPrecondition(err error) bool

func IsInternal

func IsInternal(err error) bool

func IsInvalidArgument

func IsInvalidArgument(err error) bool

func IsNotFound

func IsNotFound(err error) bool

func IsPermissionDenied added in v0.0.6

func IsPermissionDenied(err error) bool

func IsResourceExhausted added in v0.0.6

func IsResourceExhausted(err error) bool

func IsUnauthenticated

func IsUnauthenticated(err error) bool

func NewConflict

func NewConflict(err error) error

NewConflict creates a new conflict error with a given error message.

func NewFailedPrecondition added in v0.0.6

func NewFailedPrecondition(err error) error

NewFailedPrecondition creates a new FailedPrecondition error with a given error message and the original error.

func NewInternal

func NewInternal(err error) error

NewInternal creates a new Internal error with a given error message and the original error.

func NewInvalidArgument

func NewInvalidArgument(err error) error

NewInvalidArgument creates a new InvalidArgument error with a given error message and the original error.

func NewNotFound

func NewNotFound(err error) error

NewNotFound creates a new notfound error with a given error message.

func NewPermissionDenied added in v0.0.6

func NewPermissionDenied(err error) error

NewPermissionDenied creates a new PermissionDenied error with a given error message and the original error.

func NewResourceExhausted added in v0.0.6

func NewResourceExhausted(err error) error

NewResourceExhausted creates a new ResourceExhausted error with a given error message and the original error.

func NewUnauthenticated

func NewUnauthenticated(err error) error

NewUnauthenticated creates a new Unauthenticated error with a given error message and the original error.

func NotFound

func NotFound(format string, args ...any) error

NotFound creates a new notfound error with a given error message.

func PermissionDenied added in v0.0.6

func PermissionDenied(format string, args ...any) error

PermissionDenied creates a new PermissionDenied error with a given error message and the original error.

func ResourceExhausted added in v0.0.6

func ResourceExhausted(format string, args ...any) error

ResourceExhausted creates a new ResourceExhausted error with a given error message and the original error.

func Unauthenticated

func Unauthenticated(format string, args ...any) error

Unauthenticated creates a new Unauthenticated error with a given error message and the original error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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