Throw errors instead of abort()

This commit is contained in:
James Cole
2016-02-17 15:52:46 +01:00
parent 317aa591c3
commit 1a110de597
7 changed files with 55 additions and 38 deletions

View File

@@ -6,6 +6,7 @@ namespace FireflyIII\Http\Requests;
use Auth;
use Carbon\Carbon;
use Exception;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\TransactionType;
use Input;
@@ -32,6 +33,7 @@ class JournalFormRequest extends Request
public function getJournalData()
{
$tags = $this->get('tags') ?? '';
return [
'what' => $this->get('what'),
'description' => $this->get('description'),
@@ -86,7 +88,7 @@ class JournalFormRequest extends Request
$rules['category'] = 'between:1,255';
break;
default:
abort(500, 'Cannot handle ' . $what);
throw new FireflyException('Cannot handle transaction type of type ' . e($what) . '.');
break;
}