mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 05:06:37 +00:00
Catch various errors.
This commit is contained in:
@@ -42,20 +42,27 @@ class RecurrenceDestroyService
|
||||
try {
|
||||
// delete all meta data
|
||||
$recurrence->recurrenceMeta()->delete();
|
||||
|
||||
// delete all transactions.
|
||||
/** @var RecurrenceTransaction $transaction */
|
||||
foreach($recurrence->recurrenceTransactions as $transaction) {
|
||||
$transaction->recurrenceTransactionMeta()->delete();
|
||||
} catch (Exception $e) { // @codeCoverageIgnore
|
||||
Log::info(sprintf('Could not delete recurrence meta: %s', $e->getMessage())); // @codeCoverageIgnore
|
||||
}
|
||||
// delete all transactions.
|
||||
/** @var RecurrenceTransaction $transaction */
|
||||
foreach ($recurrence->recurrenceTransactions as $transaction) {
|
||||
$transaction->recurrenceTransactionMeta()->delete();
|
||||
try {
|
||||
$transaction->delete();
|
||||
} catch (Exception $e) { // @codeCoverageIgnore
|
||||
Log::info(sprintf('Could not delete recurrence transaction: %s', $e->getMessage())); // @codeCoverageIgnore
|
||||
}
|
||||
// delete all repetitions
|
||||
$recurrence->recurrenceRepetitions()->delete();
|
||||
}
|
||||
// delete all repetitions
|
||||
$recurrence->recurrenceRepetitions()->delete();
|
||||
|
||||
// delete recurrence
|
||||
// delete recurrence
|
||||
try {
|
||||
$recurrence->delete();
|
||||
} catch (Exception $e) { // @codeCoverageIgnore
|
||||
Log::error(sprintf('Could not delete recurrence: %s', $e->getMessage())); // @codeCoverageIgnore
|
||||
Log::info(sprintf('Could not delete recurrence: %s', $e->getMessage())); // @codeCoverageIgnore
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user