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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user