golang-lib/web/error.go

15 lines
469 B
Go
Raw Normal View History

2021-06-01 10:51:35 +02:00
package web
2021-07-19 17:59:47 +02:00
// HTTPError is returned in HTTP error responses.
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 (
APIErrorInvalidRequestFormat = "Invalid Request Format"
2021-07-19 17:59:47 +02:00
APIErrorInternalDatabase = "Internal Database Error"
APIErrorNotFound = "Not found"
2021-06-01 10:51:35 +02:00
)