Documentation ¶
Index ¶
- Variables
- type ResponseError
- type ResponseErrorType
- func (responseErrorType ResponseErrorType) Error() string
- func (responseErrorType ResponseErrorType) ForceWrap(err error) error
- func (responseErrorType ResponseErrorType) Is(err error) bool
- func (responseErrorType ResponseErrorType) New(message ...string) error
- func (responseErrorType ResponseErrorType) NewWithPayload(message string, payload any) error
- func (responseErrorType ResponseErrorType) Wrap(err error) error
- func (responseErrorType ResponseErrorType) WrapAndSetId(err error, id string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InternalServerError = ResponseErrorType{ Code: 500000, Name: "Internal Server Error", } UnexpectedInternalServerError = ResponseErrorType{ Code: 500001, Name: "Unexpected Internal Server Error", } InvalidArgument = ResponseErrorType{ Code: 400000, Name: "Invalid Argument", } Code: 401000, Name: "Unauthorized", } Forbidden = ResponseErrorType{ Code: 403000, Name: "Forbidden", } NotFound = ResponseErrorType{ Code: 404000, Name: "Not Found", } NotAcceptable = ResponseErrorType{ Code: 406000, Name: "Not Acceptable", } Conflict = ResponseErrorType{ Code: 409000, Name: "Conflict", } Code: 503000, Name: "Service Unavailable", } )
Functions ¶
This section is empty.
Types ¶
type ResponseError ¶
type ResponseError struct { Id string `json:"id"` Code int `json:"code"` Name string `json:"name"` Message string `json:"message"` Payload any `json:"payload"` }
func (*ResponseError) Error ¶
func (responseError *ResponseError) Error() string
func (*ResponseError) ResponseStatusCode ¶
func (responseError *ResponseError) ResponseStatusCode() int
type ResponseErrorType ¶
func (ResponseErrorType) Error ¶
func (responseErrorType ResponseErrorType) Error() string
func (ResponseErrorType) ForceWrap ¶
func (responseErrorType ResponseErrorType) ForceWrap(err error) error
func (ResponseErrorType) Is ¶
func (responseErrorType ResponseErrorType) Is(err error) bool
func (ResponseErrorType) New ¶
func (responseErrorType ResponseErrorType) New(message ...string) error
func (ResponseErrorType) NewWithPayload ¶
func (responseErrorType ResponseErrorType) NewWithPayload(message string, payload any) error
func (ResponseErrorType) Wrap ¶
func (responseErrorType ResponseErrorType) Wrap(err error) error
func (ResponseErrorType) WrapAndSetId ¶
func (responseErrorType ResponseErrorType) WrapAndSetId(err error, id string) error
Click to show internal directories.
Click to hide internal directories.