Better handling of errors.

This commit is contained in:
James Cole
2020-03-12 05:06:42 +01:00
parent d92b741088
commit 5e8d94d16a
5 changed files with 141 additions and 54 deletions

View File

@@ -332,6 +332,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
*
* @return TransactionGroup
* @throws DuplicateTransactionException
* @throws FireflyException
*/
public function store(array $data): TransactionGroup
{
@@ -343,6 +344,10 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
} catch (DuplicateTransactionException $e) {
Log::warning('Group repository caught group factory with a duplicate exception!');
throw new DuplicateTransactionException($e->getMessage());
} catch(FireflyException $e) {
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
throw new FireflyException($e->getMessage());
}