Custom HTTP error handler and send sentry notifications

This commit is contained in:
Michael Bumann
2022-01-24 23:37:03 +01:00
parent 9b292398da
commit d10701ad2f
7 changed files with 32 additions and 9 deletions

View File

@@ -39,8 +39,7 @@ func (controller *AuthController) Auth(c echo.Context) error {
accessToken, refreshToken, err := controller.svc.GenerateToken(body.Login, body.Password, body.RefreshToken)
if err != nil {
c.Logger().Infof("Generate Token error %v", err)
return c.JSON(http.StatusBadRequest, responses.BadAuthError)
return err
}
return c.JSON(http.StatusOK, echo.Map{