Skip to content

Commit

Permalink
Avoid static method when throwing exception for better trace log
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jan 18, 2024
1 parent b17b57c commit d775f90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Http/Controllers/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit d775f90

Please sign in to comment.