mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
Use it in the 1 place it seemed obvious. I have other changes where it will be used in more places. This helps standardize our codebase. ## Test plan CI
20 lines
527 B
Go
20 lines
527 B
Go
package database
|
|
|
|
// resourceNotFoundError is an error that indicates that a database resource was not found. It can be
|
|
// returned by methods that get a single resource (such as Get or GetByXyz).
|
|
//
|
|
// errcode.IsNotFound(err) == true for notFoundError values.
|
|
type resourceNotFoundError struct {
|
|
noun string
|
|
}
|
|
|
|
func (e resourceNotFoundError) Error() string {
|
|
const notFound = "not found"
|
|
if e.noun == "" {
|
|
return notFound
|
|
}
|
|
return e.noun + " " + notFound
|
|
}
|
|
|
|
func (resourceNotFoundError) NotFound() bool { return true }
|