Last active
June 17, 2022 03:12
-
-
Save nicolasparada/0c2e9e7b9855348bb51f0d8e49bffcf0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package errs | |
const ( | |
ErrUnauthenticated = UnauthenticatedError("unauthenticated") | |
ErrInvalidArgument = InvalidArgumentError("invalid argument") | |
ErrNotFound = NotFoundError("not found") | |
ErrConflict = ConflictError("conflict") | |
ErrPermissionDenied = PermissionDeniedError("permission denied") | |
ErrGone = GoneError("gone") | |
) | |
type UnauthenticatedError string | |
func (e UnauthenticatedError) Error() string { return string(e) } | |
func (e UnauthenticatedError) Is(target error) bool { return target == ErrUnauthenticated } | |
type InvalidArgumentError string | |
func (e InvalidArgumentError) Error() string { return string(e) } | |
func (e InvalidArgumentError) Is(target error) bool { return target == ErrInvalidArgument } | |
type NotFoundError string | |
func (e NotFoundError) Error() string { return string(e) } | |
func (e NotFoundError) Is(target error) bool { return target == ErrNotFound } | |
type ConflictError string | |
func (e ConflictError) Error() string { return string(e) } | |
func (e ConflictError) Is(target error) bool { return target == ErrConflict } | |
type PermissionDeniedError string | |
func (e PermissionDeniedError) Error() string { return string(e) } | |
func (e PermissionDeniedError) Is(target error) bool { return target == ErrPermissionDenied } | |
type GoneError string | |
func (e GoneError) Error() string { return string(e) } | |
func (e GoneError) Is(target error) bool { return target == ErrGone } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment