aicra/internal/config/errors.go

62 lines
2.0 KiB
Go
Raw Normal View History

package config
2021-06-21 19:50:57 +00:00
// Err allows you to create constant "const" error with type boxing.
type Err string
2021-06-21 19:50:57 +00:00
func (err Err) Error() string {
return string(err)
}
2021-06-21 19:50:57 +00:00
const (
// ErrRead - read error
ErrRead = Err("cannot read config")
2021-06-21 19:50:57 +00:00
// ErrUnknownMethod - unknown http method
ErrUnknownMethod = Err("unknown HTTP method")
2021-06-21 19:50:57 +00:00
// ErrFormat - invalid format
ErrFormat = Err("invalid config format")
2021-06-21 19:50:57 +00:00
// ErrPatternCollision - collision between 2 services' patterns
ErrPatternCollision = Err("pattern collision")
2021-06-21 19:50:57 +00:00
// ErrInvalidPattern - malformed service pattern
ErrInvalidPattern = Err("malformed service path: must begin with a '/' and not end with")
2021-06-21 19:50:57 +00:00
// ErrInvalidPatternBraceCapture - invalid brace capture
ErrInvalidPatternBraceCapture = Err("invalid uri parameter")
2021-06-21 19:50:57 +00:00
// ErrUnspecifiedBraceCapture - missing path brace capture
ErrUnspecifiedBraceCapture = Err("missing uri parameter")
2021-06-21 19:50:57 +00:00
// ErrUndefinedBraceCapture - missing capturing brace definition
ErrUndefinedBraceCapture = Err("missing uri parameter definition")
2021-06-21 19:50:57 +00:00
// ErrMandatoryRename - capture/query parameters must be renamed
ErrMandatoryRename = Err("uri and query parameters must be renamed")
2021-06-21 19:50:57 +00:00
// ErrMissingDescription - a service is missing its description
ErrMissingDescription = Err("missing description")
2021-06-21 19:50:57 +00:00
// ErrIllegalOptionalURIParam - uri parameter cannot optional
ErrIllegalOptionalURIParam = Err("uri parameter cannot be optional")
2021-06-21 19:50:57 +00:00
// ErrOptionalOption - cannot have optional output
ErrOptionalOption = Err("output cannot be optional")
2021-06-21 19:50:57 +00:00
// ErrMissingParamDesc - missing parameter description
ErrMissingParamDesc = Err("missing parameter description")
2021-06-21 19:50:57 +00:00
// ErrUnknownParamType - unknown parameter type
ErrUnknownParamType = Err("unknown parameter datatype")
2021-06-21 19:50:57 +00:00
// ErrIllegalParamName - illegal parameter name
ErrIllegalParamName = Err("illegal parameter name")
2021-06-21 19:50:57 +00:00
// ErrMissingParamType - missing parameter type
ErrMissingParamType = Err("missing parameter type")
2021-06-21 19:50:57 +00:00
// ErrParamNameConflict - name/rename conflict
ErrParamNameConflict = Err("parameter name conflict")
)