golang-lib/web/error.go

18 lines
661 B
Go
Raw Normal View History

2021-06-01 10:51:35 +02:00
package web
2021-06-01 17:41:05 +02:00
// HTTPError as a response, with data
2021-06-01 10:51:35 +02:00
type HTTPError struct {
Message string `json:"message" example:"invalid format"`
Error string `json:"error,omitempty" example:"<internal error message>"`
Data interface{} `json:"data,omitempty" swaggerignore:"true"`
}
const (
2021-06-01 17:41:05 +02:00
// APIErrorInvalidRequestFormat const for api error with invalid request format
2021-06-01 10:51:35 +02:00
APIErrorInvalidRequestFormat = "Invalid Request Format"
2021-06-01 17:41:05 +02:00
// APIErrorInternalDatabase const for api error with problem with database
APIErrorInternalDatabase = "Internal Database Error"
// APIErrorNotFound const for api error with not found object
APIErrorNotFound = "Not found"
2021-06-01 10:51:35 +02:00
)