From 38d7826218203a50a9cc130487fe32e880370fd5 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Sat, 13 Dec 2025 11:04:56 -0600 Subject: [PATCH] catch exception on judging controller --- app/Http/Controllers/Judging/JudgingController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Judging/JudgingController.php b/app/Http/Controllers/Judging/JudgingController.php index 4ca72eb..4ed9728 100644 --- a/app/Http/Controllers/Judging/JudgingController.php +++ b/app/Http/Controllers/Judging/JudgingController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Judging; use App\Actions\Tabulation\EnterScore; +use App\Exceptions\AuditionAdminException; use App\Http\Controllers\Controller; use App\Models\Audition; use App\Models\Entry; @@ -30,7 +31,7 @@ class JudgingController extends Controller $rooms = Auth::user()->judgingAssignments()->with('auditions')->with('prelimAuditions')->get(); $bonusScoresToJudge = Auth::user()->bonusJudgingAssignments()->with('auditions')->get(); - //$rooms->load('auditions'); + // $rooms->load('auditions'); return view('judging.index', compact('rooms', 'bonusScoresToJudge')); } @@ -100,7 +101,11 @@ class JudgingController extends Controller // Enter the score /** @noinspection PhpUnhandledExceptionInspection */ - $enterScore(Auth::user(), $entry, $validatedData['score']); + try { + $enterScore(Auth::user(), $entry, $validatedData['score']); + } catch (AuditionAdminException $e) { + return redirect()->back()->with('error', $e->getMessage()); + } // Deal with an advancement vote if needed $this->advancementVote($request, $entry);