mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 00:04:24 +00:00
Throw errors instead of abort()
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types = 1);
|
||||
namespace FireflyIII\Http\Controllers\Auth;
|
||||
|
||||
use Auth;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\Role;
|
||||
use FireflyIII\User;
|
||||
@@ -151,7 +152,7 @@ class AuthController extends Controller
|
||||
|
||||
return redirect($this->redirectPath());
|
||||
}
|
||||
abort(500, 'Not a user!');
|
||||
throw new FireflyException('The authenticated user object is invalid.');
|
||||
|
||||
|
||||
return redirect($this->redirectPath());
|
||||
|
@@ -3,6 +3,7 @@
|
||||
use Amount;
|
||||
use Carbon\Carbon;
|
||||
use Config;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Helpers\Report\ReportQueryInterface;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
@@ -247,7 +248,7 @@ class JsonController extends Controller
|
||||
{
|
||||
$pref = Preferences::get('tour', true);
|
||||
if (!$pref) {
|
||||
abort(404);
|
||||
throw new FireflyException('Cannot find preference for tour. Exit.');
|
||||
}
|
||||
$headers = ['main-content', 'sidebar-toggle', 'account-menu', 'budget-menu', 'report-menu', 'transaction-menu', 'option-menu', 'main-content-end'];
|
||||
$steps = [];
|
||||
|
@@ -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