Skip to content

Commit bfd1e20

Browse files
committed
Fix missing error handling
1 parent 9f332c2 commit bfd1e20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/payments.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ func (a *API) PaymentCreate(w http.ResponseWriter, r *http.Request) error {
224224
}
225225

226226
paymentComplete(r, tx, tr, order)
227-
tx.Commit()
227+
if err := tx.Commit().Error; err != nil {
228+
return internalServerError("Saving payment failed").WithInternalError(err)
229+
}
228230

229231
go sendOrderConfirmation(ctx, log, tr)
230232

0 commit comments

Comments
 (0)