Skip to content

Commit

Permalink
fix: don't override error before return (#1447)
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddyDevelop committed Apr 29, 2024
1 parent 9c799d2 commit 4bea1e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/handler/webauthn.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ func (h *WebauthnHandler) FinishRegistration(c echo.Context) error {
errorMessage = fmt.Sprintf("%s: %s: %s", errorMessage, err.Details, err.DevInfo)
errorStatus = http.StatusUnprocessableEntity
}
err = h.auditLogger.CreateWithConnection(tx, c, models.AuditLogWebAuthnRegistrationFinalFailed, user, errors.New(errorMessage))
if err != nil {
return fmt.Errorf(CreateAuditLogFailureMessage, err)
aErr := h.auditLogger.CreateWithConnection(tx, c, models.AuditLogWebAuthnRegistrationFinalFailed, user, errors.New(errorMessage))
if aErr != nil {
return fmt.Errorf(CreateAuditLogFailureMessage, aErr)
}

return echo.NewHTTPError(errorStatus, errorMessage).SetInternal(err)
Expand Down

0 comments on commit 4bea1e3

Please sign in to comment.