github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/pkg/api/error.go (about) 1 package api 2 3 import ( 4 "net/http" 5 6 "github.com/hellofresh/janus/pkg/errors" 7 ) 8 9 var ( 10 // ErrAPIDefinitionNotFound is used when the api was not found in the datastore 11 ErrAPIDefinitionNotFound = errors.New(http.StatusNotFound, "api definition not found") 12 13 // ErrAPINameExists is used when the API name is already registered on the datastore 14 ErrAPINameExists = errors.New(http.StatusConflict, "api name is already registered") 15 16 // ErrAPIListenPathExists is used when the API listen path is already registered on the datastore 17 ErrAPIListenPathExists = errors.New(http.StatusConflict, "api listen path is already registered") 18 19 // ErrDBContextNotSet is used when the database request context is not set 20 ErrDBContextNotSet = errors.New(http.StatusInternalServerError, "DB context was not set for this request") 21 )