Tets for BonusScoreController

This commit is contained in:
Matt Young 2025-07-15 11:13:33 -05:00
parent 119b8228c3
commit d09d053b6a
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,7 @@
<?php <?php
/** @noinspection PhpUnhandledExceptionInspection */
namespace App\Http\Controllers\Tabulation; namespace App\Http\Controllers\Tabulation;
use App\Actions\Tabulation\EnterBonusScore; use App\Actions\Tabulation\EnterBonusScore;
@ -9,6 +11,7 @@ use App\Http\Controllers\Controller;
use App\Models\BonusScore; use App\Models\BonusScore;
use App\Models\Entry; use App\Models\Entry;
use App\Models\User; use App\Models\User;
use Exception;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use function request; use function request;
@ -85,7 +88,7 @@ class BonusScoreController extends Controller
DB::commit(); DB::commit();
/* @codeCoverageIgnoreStart */ /* @codeCoverageIgnoreStart */
} catch (\Exception) { } catch (Exception $ex) {
DB::rollBack(); DB::rollBack();
return redirect()->route('bonus-scores.entryBonusScoreSheet', ['entry_id' => $entry->id])->with('error', 'Error entering score - '.$ex->getMessage()); return redirect()->route('bonus-scores.entryBonusScoreSheet', ['entry_id' => $entry->id])->with('error', 'Error entering score - '.$ex->getMessage());