restErrorHandler

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrConflictToResponse

func ErrConflictToResponse(err errs.ErrConflict) errorResponses.ErrorResponse

func ErrValidationToResponse

func ErrValidationToResponse(err errs.ErrValidation) errorResponses.ErrorResponse

func ErrorHandler

func ErrorHandler(gc *gin.Context, internalErrorLogMessage string, err error)

ErrorHandler determines the appropriate error response and code from the error type. It relies on the types defined in errs. The default case is an internal server error hiding the implementation details from the client. In this case a log message is issued containing the error. A log message for context can be provided via parameter internalErrorLogMessage.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL