Documentation
¶
Overview ¶
Package mark provides a mechanism for tagging errors with a well-known error value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errors.New("not found") ErrAlreadyExists = errors.New("already exists") ErrBadRequest = errors.New("bad request") ErrCancelled = errors.New("request cancelled") ErrTimedout = errors.New("request timed out") ErrTooLarge = errors.New("request is too large") ErrTooManyRequests = errors.New("too many requests") ErrForbidden = errors.New("forbidden") )
This list of errors is not exhaustive, but is a good starting point for most applications. Feel free to add more as needed, but don't go overboard. Remember, the specific types of errors are only important so far as someone calling your code might want to write logic to handle each type of error differently.
Do not add application-specific errors to this list. Instead, just define your own package with your own application-specific errors, and use this package to mark errors with them. The errors in this package are not special, they're just plain old errors.
Not all errors need to be marked. An error that is not marked should be treated as an unexpected error that cannot be handled by calling code. This is often the case for network errors or logic errors.
Functions ¶
Types ¶
This section is empty.