Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorHandler = func(c *fiber.Ctx, err error) error { resp := Response{ Code: fiber.StatusInternalServerError, } if e, ok := err.(validator.ValidationErrors); ok { resp.Code = fiber.StatusForbidden resp.Messages = Messages{removeTopStruct(e.Translate(trans))} } else if e, ok := err.(*fiber.Error); ok { resp.Code = e.Code resp.Messages = Messages{e.Message} } else if e, ok := err.(*Error); ok { resp.Code = e.Code resp.Messages = Messages{e.Message} if resp.Messages == nil { resp.Messages = Messages{err} } } else { resp.Messages = Messages{err.Error()} } if !IsProduction { log.Error().Err(err).Msg("From: Fiber's error handler") } return Resp(c, resp) }
Default error handler
View Source
var IsProduction bool
Nothing to describe this fucking variable.
Functions ¶
func ParseAndValidate ¶
func ValidateStruct ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.