Package errkind is used to create and detect specific kinds of errors.
errkind
Read the package documentation for more information.