catch exception on judging controller
This commit is contained in:
parent
59629e227d
commit
38d7826218
|
|
@ -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 */
|
||||
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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue