catch errors

This commit is contained in:
Denis Duliçi
2020-07-10 13:37:48 +03:00
parent a2bd4758ad
commit 0c061a01ea
3 changed files with 23 additions and 5 deletions

View File

@@ -78,8 +78,13 @@ class BillReminder extends Command
$bills = Bill::with('contact')->accrued()->notPaid()->due($date)->cursor();
foreach ($bills as $bill) {
event(new BillReminded($bill));
try {
event(new BillReminded($bill));
} catch (\Exception | \Throwable | \Swift_RfcComplianceException | \Illuminate\Database\QueryException $e) {
$this->error($e->getMessage());
logger('Bill reminder:: ' . $e->getMessage());
}
}
}
}