Documentation ¶
Index ¶
- func ErrorResponse(w http.ResponseWriter, message string, httpStatusCode int)
- func WriteInternalError(w http.ResponseWriter, verr *VerboseError, r *http.Request, log *logrus.Entry)
- func WriteNotFoundError(err error, w http.ResponseWriter, log *logrus.Entry)
- func WriteResponse(w http.ResponseWriter, body any, httpStatusCode int)
- type Error
- type VerboseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, message string, httpStatusCode int)
func WriteInternalError ¶
func WriteInternalError(w http.ResponseWriter, verr *VerboseError, r *http.Request, log *logrus.Entry)
func WriteNotFoundError ¶
func WriteNotFoundError(err error, w http.ResponseWriter, log *logrus.Entry)
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, body any, httpStatusCode int)
Types ¶
type VerboseError ¶
type VerboseError struct { Class string Message string Method string Endpoint string OriginalError error }
func NewNotFoundError ¶
func NewNotFoundError(r *http.Request) *VerboseError
func NewVerboseError ¶
func NewVerboseError(class string, r *http.Request, err error) *VerboseError
func (*VerboseError) Error ¶
func (v *VerboseError) Error() string
Click to show internal directories.
Click to hide internal directories.