17 lines
795 B
Go
17 lines
795 B
Go
package handlers
|
|
|
|
import "errors"
|
|
|
|
// Sentinel errors the handlers branch on with errors.Is to decide which
|
|
// problem response a failure deserves. They exist to separate a client's
|
|
// mistake from a server fault where the code that detects both is the same
|
|
// code — the repositories return plain errors, so without these every failure
|
|
// out of a lookup would have to be answered as a 500.
|
|
|
|
// errUnknownCatagoryID reports that a submitted category id is not in the
|
|
// category table. It is kept distinct from the error the lookup itself
|
|
// returns because the two are not the same kind of failure: an id nobody has
|
|
// is the client's mistake and answers 404, while a lookup that could not run
|
|
// is the server's and answers 500.
|
|
var errUnknownCatagoryID = errors.New("unknown catagory id")
|