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

@ -145,8 +145,15 @@ class RecurringCheck extends Command
$model->cloneable_relations = ['items', 'totals'];
// Create new record
$clone = $model->duplicate();
try {
$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
$clone->parent_id = $model->id;