Sentry integration
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"forge.cadoles.com/wpetit/hydra-passwordless/internal/config"
|
||||
"forge.cadoles.com/wpetit/hydra-passwordless/internal/hydra"
|
||||
"forge.cadoles.com/wpetit/hydra-passwordless/internal/query"
|
||||
"github.com/getsentry/sentry-go"
|
||||
"github.com/pkg/errors"
|
||||
"gitlab.com/wpetit/goweb/cqrs"
|
||||
"gitlab.com/wpetit/goweb/logger"
|
||||
@ -32,6 +33,7 @@ func handleVerification(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
result, err := bus.Query(ctx, qry)
|
||||
if err != nil {
|
||||
sentry.CaptureException(err)
|
||||
logger.Error(ctx, "could not verify token", logger.E(err))
|
||||
|
||||
err := renderErrorPage(
|
||||
@ -49,7 +51,9 @@ func handleVerification(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
verifyUserData, ok := result.Data().(*query.VerifyUserData)
|
||||
if !ok {
|
||||
panic(errors.New("unexpected result data"))
|
||||
err := errors.New("unexpected result data")
|
||||
sentry.CaptureException(err)
|
||||
panic(err)
|
||||
}
|
||||
|
||||
hydr := hydra.Must(ctn)
|
||||
@ -70,6 +74,7 @@ func handleVerification(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
res, err := hydr.AcceptLoginRequest(verifyUserData.Challenge, accept)
|
||||
if err != nil {
|
||||
sentry.CaptureException(err)
|
||||
logger.Error(ctx, "could not retrieve hydra accept response", logger.E(err))
|
||||
|
||||
err := renderErrorPage(
|
||||
|
Reference in New Issue
Block a user