From d775f9062eeab88a0838a83525ef041e59866e17 Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Thu, 18 Jan 2024 00:50:18 +0000 Subject: [PATCH] Avoid static method when throwing exception for better trace log Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> --- src/Http/Controllers/Orders.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Http/Controllers/Orders.php b/src/Http/Controllers/Orders.php index 1cf3337..1b6514e 100644 --- a/src/Http/Controllers/Orders.php +++ b/src/Http/Controllers/Orders.php @@ -73,7 +73,7 @@ public function index() public function index_onDelete() { throw_unless($this->authorize('Admin.DeleteOrders'), - FlashException::error(lang('igniter::admin.alert_user_restricted')) + new FlashException(lang('igniter::admin.alert_user_restricted')) ); return $this->asExtension(\Igniter\Admin\Http\Actions\ListController::class)->index_onDelete(); @@ -97,7 +97,7 @@ public function index_onUpdateStatus() public function edit_onDelete($context, $recordId) { throw_unless($this->authorize('Admin.DeleteOrders'), - FlashException::error(lang('igniter::admin.alert_user_restricted')) + new FlashException(lang('igniter::admin.alert_user_restricted')) ); return $this->asExtension(\Igniter\Admin\Http\Actions\FormController::class)->edit_onDelete($context, $recordId); @@ -108,7 +108,7 @@ public function invoice($context, $recordId = null) $model = $this->formFindModelObject($recordId); throw_unless($model->hasInvoice(), - FlashException::error(lang('igniter.cart::default.orders.alert_invoice_not_generated')) + new FlashException(lang('igniter.cart::default.orders.alert_invoice_not_generated')) ); $this->vars['model'] = $model;