Skip to content

Commit

Permalink
IMprove log to trace error
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Nogueira Gonçalves committed Jul 21, 2021
1 parent df593c2 commit f4aface
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions api/membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func ApplyForMembershipHandler(app *App) func(c echo.Context) error {
txErr := app.Rollback(tx, "Membership application failed", c, logger, err)
if txErr != nil {
log.E(logger, "Could not rollback transaction", func(cm log.CM) {
cm.Write(zap.Error(txErr))
cm.Write(zap.Error(err))
})
}

Expand All @@ -100,7 +100,7 @@ func ApplyForMembershipHandler(app *App) func(c echo.Context) error {
txErr := app.Rollback(tx, "Membership application failed", c, logger, err)
if txErr != nil {
log.E(logger, "Could not rollback transaction", func(cm log.CM) {
cm.Write(zap.Error(txErr))
cm.Write(zap.Error(err))
})
}

Expand Down Expand Up @@ -207,7 +207,7 @@ func InviteForMembershipHandler(app *App) func(c echo.Context) error {
txErr := app.Rollback(tx, "Membership invitation dispatch hook failed", c, logger, err)
if txErr != nil {
log.E(logger, "Could not rollback transaction", func(cm log.CM) {
cm.Write(zap.Error(txErr))
cm.Write(zap.Error(err))
})
}

Expand Down Expand Up @@ -289,7 +289,7 @@ func ApproveOrDenyMembershipApplicationHandler(app *App) func(c echo.Context) er
txErr := rollback(err)
if txErr == nil {
log.E(logger, "Could not rollback transaction", func(cm log.CM) {
cm.Write(zap.Error(txErr))
cm.Write(zap.Error(err))
})
}
return FailWithError(err, c)
Expand All @@ -301,7 +301,7 @@ func ApproveOrDenyMembershipApplicationHandler(app *App) func(c echo.Context) er
txErr := rollback(err)
if txErr == nil {
log.E(logger, "Could not rollback transaction", func(cm log.CM) {
cm.Write(zap.Error(txErr))
cm.Write(zap.Error(err))
})
}
log.E(logger, "Requestor details retrieval failed", func(cm log.CM) {
Expand Down Expand Up @@ -329,7 +329,7 @@ func ApproveOrDenyMembershipApplicationHandler(app *App) func(c echo.Context) er
txErr := rollback(err)
if txErr == nil {
log.E(logger, "Could not rollback transaction", func(cm log.CM) {
cm.Write(zap.Error(txErr))
cm.Write(zap.Error(err))
})
}

Expand Down Expand Up @@ -418,7 +418,7 @@ func ApproveOrDenyMembershipInvitationHandler(app *App) func(c echo.Context) err
txErr := rollback(err)
if txErr == nil {
log.E(logger, "Could not rollback transaction", func(cm log.CM) {
cm.Write(zap.Error(txErr))
cm.Write(zap.Error(err))
})
}

Expand Down Expand Up @@ -527,7 +527,7 @@ func DeleteMembershipHandler(app *App) func(c echo.Context) error {
txErr := rollback(err)
if txErr == nil {
log.E(logger, "Could not rollback transaction", func(cm log.CM) {
cm.Write(zap.Error(txErr))
cm.Write(zap.Error(err))
})
}

Expand Down

0 comments on commit f4aface

Please sign in to comment.