Various code cleanup.

This commit is contained in:
James Cole
2021-04-07 07:28:43 +02:00
parent 4ddcb0c965
commit f12744ad8c
180 changed files with 714 additions and 721 deletions

View File

@@ -69,7 +69,7 @@ class RecurrenceFactory
Log::error($message);
Log::error($e->getTraceAsString());
throw new FireflyException($message);
throw new FireflyException($message, 0, $e);
}
$firstDate = null;
$repeatUntil = null;
@@ -129,17 +129,16 @@ class RecurrenceFactory
$this->createRepetitions($recurrence, $data['repetitions'] ?? []);
try {
$this->createTransactions($recurrence, $data['transactions'] ?? []);
// @codeCoverageIgnoreStart
} catch (FireflyException $e) {
Log::error($e->getMessage());
$recurrence->forceDelete();
$message = sprintf('Could not create recurring transaction: %s', $e->getMessage());
$this->errors->add('store', $message);
throw new FireflyException($message);
throw new FireflyException($message, 0, $e);
}
// @codeCoverageIgnoreEnd
return $recurrence;
}