Skip to content

Glossary: Go in Practice

Sentinel error

Also written: ErrNotFound, ErrInvalid, sentinel

A package-level error value, such as `ErrNotFound`, that callers compare with `errors.Is`. The API turns `ErrNotFound` into a 404 and `ErrInvalid` into a 400.

Where the book teaches it

Related terms

errors.IsWrapping errors with %w