Skip to content

Commit

Permalink
use throw instead exit
Browse files Browse the repository at this point in the history
  • Loading branch information
devton committed Mar 6, 2024
1 parent 63770a5 commit d1d5ca1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/hook-service-api/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ server.post('/postbacks/:gateway_name', async (req, resp) => {
) as last_payment on true
where cp.id = $1::uuid and (cp.gateway_general_data->>'gateway_id')::text = $2::text`
, [req.body.transaction.metadata.payment_id, req.body.transaction.id]);
if(R.isEmpty(res.rows) || res.rows == null) {
exit(1, 'payment not found');
if(R.isEmpty(res.rows) || R.isNil(res.rows)) {
throw 'payment not found'
}

const payment = res.rows[0].payment_data;
Expand Down

0 comments on commit d1d5ca1

Please sign in to comment.