Versions in this module Expand all Collapse all v0 v0.1.5 Nov 26, 2025 Changes in this version + const ErrCodeBusinessBase + const ErrCodeDBBase + const ErrCodeDBConnection + const ErrCodeDBDelete + const ErrCodeDBInsert + const ErrCodeDBQuery + const ErrCodeDBUpdate + const ErrCodeForbidden + const ErrCodeInternal + const ErrCodeInvalidParam + const ErrCodeInvalidToken + const ErrCodeNotFound + const ErrCodeServiceBase + const ErrCodeServiceDown + const ErrCodeServiceTimeout + const ErrCodeTimeout + const ErrCodeTokenExpired + const ErrCodeTooManyRequest + const ErrCodeUnauthorized + const ErrCodeUnknown + func As(err error, target interface{}) bool + func DefaultErrorHandler(w ResponseWriter, err error) + func GetDefaultMessage(code int) string + func GetDefaultStatus(code int) int + func GinCustomError(c *gin.Context, code int, message string) + func GinDefaultErrorMiddleware() gin.HandlerFunc + func GinError(c *gin.Context, err *Error) + func GinErrorMiddleware(filters ...ErrorFilter) gin.HandlerFunc + func GinForbidden(c *gin.Context, reason string) + func GinInternal(c *gin.Context, err error) + func GinInvalidParam(c *gin.Context, paramName string) + func GinMissingParam(c *gin.Context, paramName string) + func GinNotFound(c *gin.Context, resource string) + func GinUnauthorized(c *gin.Context, reason string) + func HandleGinError(c *gin.Context, err error) + func Is(err error, code int) bool + func RecoveryMiddleware(next http.Handler) http.Handler + type Error struct + Cause error + Code int + Data interface{} + File string + Line int + Message string + Stack string + Status int + func Forbidden(reason string) *Error + func Internal(err error) *Error + func InvalidParam(paramName string) *Error + func MissingParam(paramName string) *Error + func New(code int) *Error + func NotFound(resource string) *Error + func SensitiveDataFilter(err *Error) *Error + func Unauthorized(reason string) *Error + func Wrap(err error, code int) *Error + func WrapWithMessage(err error, code int, message string) *Error + func (e *Error) Error() string + func (e *Error) GetStatus() int + func (e *Error) Unwrap() error + func (e *Error) WithCause(cause error) *Error + func (e *Error) WithData(data interface{}) *Error + func (e *Error) WithMessage(message string) *Error + func (e *Error) WithStatus(status int) *Error + type ErrorFilter func(err *Error) *Error + type ErrorHandler interface + HandleError func(ctx types.RequestContext, err error) + type ErrorHandlerFunc func(w ResponseWriter, err error) + type ErrorResponse struct + Code int + Data interface{} + Message string + type ResponseWriter interface + JSON func(code int, obj interface{})