catch errors
This commit is contained in:
parent
a2bd4758ad
commit
0c061a01ea
@ -78,8 +78,13 @@ class BillReminder extends Command
|
|||||||
$bills = Bill::with('contact')->accrued()->notPaid()->due($date)->cursor();
|
$bills = Bill::with('contact')->accrued()->notPaid()->due($date)->cursor();
|
||||||
|
|
||||||
foreach ($bills as $bill) {
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,13 @@ class InvoiceReminder extends Command
|
|||||||
$invoices = Invoice::with('contact')->accrued()->notPaid()->due($date)->cursor();
|
$invoices = Invoice::with('contact')->accrued()->notPaid()->due($date)->cursor();
|
||||||
|
|
||||||
foreach ($invoices as $invoice) {
|
foreach ($invoices as $invoice) {
|
||||||
event(new InvoiceReminded($invoice));
|
try {
|
||||||
|
event(new InvoiceReminded($invoice));
|
||||||
|
} catch (\Exception | \Throwable | \Swift_RfcComplianceException | \Illuminate\Database\QueryException $e) {
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
|
||||||
|
logger('Invoice reminder:: ' . $e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,8 +145,15 @@ class RecurringCheck extends Command
|
|||||||
|
|
||||||
$model->cloneable_relations = ['items', 'totals'];
|
$model->cloneable_relations = ['items', 'totals'];
|
||||||
|
|
||||||
// Create new record
|
try {
|
||||||
$clone = $model->duplicate();
|
$clone = $model->duplicate();
|
||||||
|
} catch (\Exception | \Throwable | \Swift_RfcComplianceException | \Illuminate\Database\QueryException $e) {
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
|
||||||
|
logger('Recurring check:: ' . $e->getMessage());
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Set original model id
|
// Set original model id
|
||||||
$clone->parent_id = $model->id;
|
$clone->parent_id = $model->id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user