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 c, ok := err.(validator.ValidationErrors); ok { resp.Code = fiber.StatusUnprocessableEntity resp.Messages = Messages{removeTopStruct(c.Translate(trans))} } else if c, ok := err.(*fiber.Error); ok { resp.Code = c.Code resp.Messages = Messages{c.Message} } else if c, ok := err.(*Error); ok { resp.Code = c.Code resp.Messages = Messages{c.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
nothiing to describe this fucking variable
Functions ¶
func ParseAndValidate ¶
func ValidateStruct ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.