Add some debug info

This commit is contained in:
James Cole 2020-05-16 06:59:15 +02:00
parent b248bd6d0c
commit 9a52cfbfbe
3 changed files with 3 additions and 2 deletions

View File

@ -283,7 +283,7 @@ class TransactionController extends Controller
try {
$transactionGroup = $this->groupRepository->store($data);
} catch (DuplicateTransactionException $e) {
Log::warning('Caught a duplicate. Return error message.');
Log::warning('Caught a duplicate transaction. Return error message.');
// return bad validation message.
// TODO use Laravel's internal validation thing to do this.
$response = [

View File

@ -428,7 +428,7 @@ class TransactionJournalFactory
->first();
}
if (null !== $result) {
Log::warning('Found a duplicate!');
Log::warning(sprintf('Found a duplicate in errorIfDuplicate because hash %s is not unique!', $hash));
throw new DuplicateTransactionException(sprintf('Duplicate of transaction #%d.', $result->transactionJournal->transaction_group_id));
}
}

View File

@ -346,6 +346,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
Log::warning('Group repository caught group factory with a duplicate exception!');
throw new DuplicateTransactionException($e->getMessage());
} catch(FireflyException $e) {
Log::warning('Group repository caught group factory with an exception!');
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
throw new FireflyException($e->getMessage());