More consistent error handling.

This commit is contained in:
James Cole
2016-02-06 05:01:34 +01:00
parent 69d0c31ae5
commit 241190c4da
7 changed files with 25 additions and 24 deletions

View File

@@ -7,6 +7,7 @@ use Config;
use ExpandedForm;
use FireflyIII\Events\TransactionJournalStored;
use FireflyIII\Events\TransactionJournalUpdated;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Requests\JournalFormRequest;
use FireflyIII\Models\PiggyBank;
@@ -141,7 +142,7 @@ class TransactionController extends Controller
{
// cannot edit opening balance
if ($journal->isOpeningBalance()) {
return view('error')->with('message', 'Cannot edit this transaction. Edit the account instead!');
throw new FireflyException('Cannot edit this transaction (#' . $journal->id . '). Edit the account instead!');
}