mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Catch "throwable"
This commit is contained in:
@@ -28,6 +28,8 @@ use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Class BudgetController.
|
||||
@@ -43,7 +45,6 @@ class BudgetController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return mixed|string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function general(Collection $accounts, Carbon $start, Carbon $end)
|
||||
{
|
||||
@@ -58,8 +59,12 @@ class BudgetController extends Controller
|
||||
}
|
||||
$helper = app(BudgetReportHelperInterface::class);
|
||||
$budgets = $helper->getBudgetReport($start, $end, $accounts);
|
||||
|
||||
$result = view('reports.partials.budgets', compact('budgets'))->render();
|
||||
try {
|
||||
$result = view('reports.partials.budgets', compact('budgets'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::debug(sprintf('Could not render reports.partials.budgets: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
}
|
||||
$cache->store($result);
|
||||
|
||||
return $result;
|
||||
@@ -74,7 +79,6 @@ class BudgetController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return mixed|string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function period(Collection $accounts, Carbon $start, Carbon $end)
|
||||
{
|
||||
@@ -95,8 +99,12 @@ class BudgetController extends Controller
|
||||
$data[0] = $repository->getNoBudgetPeriodReport($accounts, $start, $end); // append report data for "no budget"
|
||||
$report = $this->filterBudgetPeriodReport($data);
|
||||
$periods = app('navigation')->listOfPeriods($start, $end);
|
||||
|
||||
$result = view('reports.partials.budget-period', compact('report', 'periods'))->render();
|
||||
try {
|
||||
$result = view('reports.partials.budget-period', compact('report', 'periods'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
}
|
||||
$cache->store($result);
|
||||
|
||||
return $result;
|
||||
|
Reference in New Issue
Block a user