Various code cleanup.

This commit is contained in:
James Cole
2021-04-06 08:51:27 +02:00
parent d32446b171
commit 5ceef2e9c3
47 changed files with 161 additions and 557 deletions

View File

@@ -94,13 +94,13 @@ class StoreController extends Controller
$validator = Validator::make(
['transactions' => [['description' => $e->getMessage()]]], ['transactions.0.description' => new IsDuplicateTransaction]
);
throw new ValidationException($validator);
throw new ValidationException($validator,0, $e);
} catch (FireflyException $e) {
Log::warning('Caught an exception. Return error message.');
Log::error($e->getMessage());
$message = sprintf('Internal exception: %s', $e->getMessage());
$validator = Validator::make(['transactions' => [['description' => $message]]], ['transactions.0.description' => new IsDuplicateTransaction]);
throw new ValidationException($validator);
throw new ValidationException($validator,0, $e);
}
app('preferences')->mark();
event(new StoredTransactionGroup($transactionGroup, $data['apply_rules'] ?? true));