mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 07:38:29 +00:00
Throw errors instead of abort()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user