Throw exception in catch block to ensure that the code execution / flowed stops

- This to prevent broken data to be entered into tables
This commit is contained in:
Afiq Hamzah
2024-08-01 14:50:51 +08:00
parent f4f0276a1e
commit c48ffc22c8
2 changed files with 11 additions and 0 deletions
@@ -116,6 +116,8 @@ class BayaranController extends Controller
} catch (\Exception $e) {
OnlineTransactionLoggerService::logs($bill['id'], $paymentArray, $e->getMessage(), TransactionOnlineStatus::INITIALIZED_TRANSACTION);
throw $e;
}
try {
@@ -130,6 +132,8 @@ class BayaranController extends Controller
} catch (\Exception $e) {
OnlineTransactionLoggerService::logs($bill['id'], $paymentArray, $e->getMessage(), TransactionOnlineStatus::UPDATED_TAG_PORTAL);
throw $e;
}
return true;