refactor: log actual errors when an error takes place

This commit is contained in:
Stavros
2025-04-25 17:03:12 +03:00
parent 4dc6bc0c98
commit 1c738b718a

View File

@@ -608,7 +608,7 @@ func (h *Handlers) OauthCallbackHandler(c *gin.Context) {
// Handle error // Handle error
if err != nil { if err != nil {
log.Error().Msg("Failed to exchange token") log.Error().Err(err).Msg("Failed to exchange token")
c.Redirect(http.StatusPermanentRedirect, fmt.Sprintf("%s/error", h.Config.AppURL)) c.Redirect(http.StatusPermanentRedirect, fmt.Sprintf("%s/error", h.Config.AppURL))
return return
} }
@@ -620,7 +620,7 @@ func (h *Handlers) OauthCallbackHandler(c *gin.Context) {
// Handle error // Handle error
if err != nil { if err != nil {
log.Error().Msg("Failed to get email") log.Error().Err(err).Msg("Failed to get email")
c.Redirect(http.StatusPermanentRedirect, fmt.Sprintf("%s/error", h.Config.AppURL)) c.Redirect(http.StatusPermanentRedirect, fmt.Sprintf("%s/error", h.Config.AppURL))
return return
} }
@@ -636,7 +636,7 @@ func (h *Handlers) OauthCallbackHandler(c *gin.Context) {
// Handle error // Handle error
if err != nil { if err != nil {
log.Error().Msg("Failed to build queries") log.Error().Err(err).Msg("Failed to build queries")
c.Redirect(http.StatusPermanentRedirect, fmt.Sprintf("%s/error", h.Config.AppURL)) c.Redirect(http.StatusPermanentRedirect, fmt.Sprintf("%s/error", h.Config.AppURL))
return return
} }
@@ -673,7 +673,7 @@ func (h *Handlers) OauthCallbackHandler(c *gin.Context) {
// Handle error // Handle error
if err != nil { if err != nil {
log.Error().Msg("Failed to build queries") log.Error().Err(err).Msg("Failed to build queries")
c.Redirect(http.StatusPermanentRedirect, fmt.Sprintf("%s/error", h.Config.AppURL)) c.Redirect(http.StatusPermanentRedirect, fmt.Sprintf("%s/error", h.Config.AppURL))
return return
} }