errdefs

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package errdefs defines the error types that are understood by other packages in this project. Consumers of this project should look here to know how to produce and consume errors for this project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsNotFound

func AsNotFound(err error) error

AsNotFound wraps the passed in error to make it of type ErrNotFound

Callers should make sure the passed in error has exactly the error message it wants as this function does not decorate the message.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound determines if the passed in error is of type ErrNotFound

This will traverse the causal chain (`Cause() error`), until it finds an error which implements the `NotFound` interface.

func NotFound

func NotFound(msg string) error

NotFound makes an ErrNotFound from the provided error message.

func NotFoundf

func NotFoundf(format string, args ...interface{}) error

NotFoundf makes an ErrNotFound from the provided error format and args.

Types

type ErrNotFound

type ErrNotFound interface {
	NotFound() bool
	error
}

NotFound is an error interface which denotes whether the opration failed due to a the resource not being found.

Jump to

Keyboard shortcuts

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