Remove record not found exception

This commit is contained in:
Lance Pioch 2024-03-16 23:34:45 -04:00
parent dece74c185
commit 1172fec6e5
37 changed files with 0 additions and 77 deletions

View File

@ -15,7 +15,6 @@ class DisableTwoFactorCommand extends Command
* Handle command execution process. * Handle command execution process.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function handle() public function handle()
{ {

View File

@ -2,7 +2,6 @@
namespace App\Exceptions; namespace App\Exceptions;
use Exception;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
@ -19,7 +18,6 @@ use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\Mailer\Exception\TransportException; use Symfony\Component\Mailer\Exception\TransportException;
use App\Exceptions\Repository\RecordNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
@ -40,7 +38,6 @@ class Handler extends ExceptionHandler
AuthorizationException::class, AuthorizationException::class,
HttpException::class, HttpException::class,
ModelNotFoundException::class, ModelNotFoundException::class,
RecordNotFoundException::class,
TokenMismatchException::class, TokenMismatchException::class,
ValidationException::class, ValidationException::class,
]; ];

View File

@ -1,25 +0,0 @@
<?php
namespace App\Exceptions\Repository;
use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class RecordNotFoundException extends RepositoryException implements HttpExceptionInterface
{
/**
* Returns the status code.
*/
public function getStatusCode(): int
{
return Response::HTTP_NOT_FOUND;
}
/**
* Returns response headers.
*/
public function getHeaders(): array
{
return [];
}
}

View File

@ -22,7 +22,6 @@ class DynamicDatabaseConnection
/** /**
* Adds a dynamic database connection entry to the runtime config. * Adds a dynamic database connection entry to the runtime config.
* *
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function set(string $connection, DatabaseHost|int $host, string $database = 'mysql'): void public function set(string $connection, DatabaseHost|int $host, string $database = 'mysql'): void
{ {

View File

@ -47,7 +47,6 @@ class DatabaseController extends Controller
/** /**
* Display database host to user. * Display database host to user.
* *
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function view(int $host): View public function view(int $host): View
{ {

View File

@ -40,7 +40,6 @@ class EggController extends Controller
/** /**
* Handle a request to display the Egg creation page. * Handle a request to display the Egg creation page.
* *
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function create(): View public function create(): View
{ {
@ -86,7 +85,6 @@ class EggController extends Controller
* Handle request to update an Egg. * Handle request to update an Egg.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
* @throws \App\Exceptions\Service\Egg\NoParentConfigurationFoundException * @throws \App\Exceptions\Service\Egg\NoParentConfigurationFoundException
*/ */
public function update(EggFormRequest $request, Egg $egg): RedirectResponse public function update(EggFormRequest $request, Egg $egg): RedirectResponse

View File

@ -51,7 +51,6 @@ class EggScriptController extends Controller
* Handle a request to update the installation script for an Egg. * Handle a request to update the installation script for an Egg.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function update(EggScriptFormRequest $request, Egg $egg): RedirectResponse public function update(EggScriptFormRequest $request, Egg $egg): RedirectResponse
{ {

View File

@ -25,9 +25,6 @@ class EggShareController extends Controller
) { ) {
} }
/**
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/
public function export(Egg $egg): Response public function export(Egg $egg): Response
{ {
$filename = trim(preg_replace('/\W/', '-', kebab_case($egg->name)), '-'); $filename = trim(preg_replace('/\W/', '-', kebab_case($egg->name)), '-');
@ -44,7 +41,6 @@ class EggShareController extends Controller
* Import a new egg using an XML file. * Import a new egg using an XML file.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
* @throws \App\Exceptions\Service\Egg\BadJsonFormatException * @throws \App\Exceptions\Service\Egg\BadJsonFormatException
* @throws \App\Exceptions\Service\InvalidFileUploadException * @throws \App\Exceptions\Service\InvalidFileUploadException
*/ */
@ -60,7 +56,6 @@ class EggShareController extends Controller
* Update an existing Egg using a new imported file. * Update an existing Egg using a new imported file.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
* @throws \App\Exceptions\Service\Egg\BadJsonFormatException * @throws \App\Exceptions\Service\Egg\BadJsonFormatException
* @throws \App\Exceptions\Service\InvalidFileUploadException * @throws \App\Exceptions\Service\InvalidFileUploadException
*/ */

View File

@ -56,7 +56,6 @@ class EggVariableController extends Controller
* *
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
* @throws \App\Exceptions\Service\Egg\Variable\ReservedVariableNameException * @throws \App\Exceptions\Service\Egg\Variable\ReservedVariableNameException
*/ */
public function update(EggVariableFormRequest $request, Egg $egg, EggVariable $variable): RedirectResponse public function update(EggVariableFormRequest $request, Egg $egg, EggVariable $variable): RedirectResponse

View File

@ -38,7 +38,6 @@ class MountController extends Controller
/** /**
* Return the mount view page. * Return the mount view page.
* *
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function view(string $id): View public function view(string $id): View
{ {

View File

@ -66,7 +66,6 @@ class NodesController extends Controller
* *
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function updateSettings(NodeFormRequest $request, Node $node): RedirectResponse public function updateSettings(NodeFormRequest $request, Node $node): RedirectResponse
{ {
@ -127,7 +126,6 @@ class NodesController extends Controller
* Sets an alias for a specific allocation on a node. * Sets an alias for a specific allocation on a node.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function allocationSetAlias(AllocationAliasFormRequest $request): \Symfony\Component\HttpFoundation\Response public function allocationSetAlias(AllocationAliasFormRequest $request): \Symfony\Component\HttpFoundation\Response
{ {

View File

@ -27,7 +27,6 @@ class CreateServerController extends Controller
/** /**
* Displays the create server page. * Displays the create server page.
* *
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function index(): View|RedirectResponse public function index(): View|RedirectResponse
{ {

View File

@ -59,7 +59,6 @@ class ServerViewController extends Controller
/** /**
* Returns the server startup management page. * Returns the server startup management page.
* *
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function startup(Request $request, Server $server): View public function startup(Request $request, Server $server): View
{ {

View File

@ -53,7 +53,6 @@ class ServersController extends Controller
* Update the details for a server. * Update the details for a server.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function setDetails(Request $request, Server $server): RedirectResponse public function setDetails(Request $request, Server $server): RedirectResponse
{ {
@ -71,7 +70,6 @@ class ServersController extends Controller
* *
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function toggleInstall(Server $server): RedirectResponse public function toggleInstall(Server $server): RedirectResponse
{ {
@ -92,7 +90,6 @@ class ServersController extends Controller
* *
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function reinstallServer(Server $server): RedirectResponse public function reinstallServer(Server $server): RedirectResponse
{ {
@ -107,7 +104,6 @@ class ServersController extends Controller
* *
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function manageSuspension(Request $request, Server $server): RedirectResponse public function manageSuspension(Request $request, Server $server): RedirectResponse
{ {
@ -123,7 +119,6 @@ class ServersController extends Controller
* Update the build configuration for a server. * Update the build configuration for a server.
* *
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Repository\RecordNotFoundException
* @throws \Illuminate\Validation\ValidationException * @throws \Illuminate\Validation\ValidationException
*/ */
public function updateBuild(Request $request, Server $server): RedirectResponse public function updateBuild(Request $request, Server $server): RedirectResponse

View File

@ -45,7 +45,6 @@ class AdvancedController extends Controller
/** /**
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function update(AdvancedSettingsFormRequest $request): RedirectResponse public function update(AdvancedSettingsFormRequest $request): RedirectResponse
{ {

View File

@ -43,7 +43,6 @@ class IndexController extends Controller
* Handle settings update. * Handle settings update.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function update(BaseSettingsFormRequest $request): RedirectResponse public function update(BaseSettingsFormRequest $request): RedirectResponse
{ {

View File

@ -46,7 +46,6 @@ class MailController extends Controller
* *
* @throws DisplayException * @throws DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function update(MailSettingsFormRequest $request): Response public function update(MailSettingsFormRequest $request): Response
{ {

View File

@ -114,7 +114,6 @@ class UserController extends Controller
* Update a user on the system. * Update a user on the system.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function update(UserFormRequest $request, User $user): RedirectResponse public function update(UserFormRequest $request, User $user): RedirectResponse
{ {

View File

@ -49,7 +49,6 @@ class ServerController extends ApplicationApiController
* @throws \Illuminate\Validation\ValidationException * @throws \Illuminate\Validation\ValidationException
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
* @throws \App\Exceptions\Service\Deployment\NoViableAllocationException * @throws \App\Exceptions\Service\Deployment\NoViableAllocationException
* @throws \App\Exceptions\Service\Deployment\NoViableNodeException * @throws \App\Exceptions\Service\Deployment\NoViableNodeException
*/ */

View File

@ -27,7 +27,6 @@ class ServerDetailsController extends ApplicationApiController
* *
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function details(UpdateServerDetailsRequest $request, Server $server): array public function details(UpdateServerDetailsRequest $request, Server $server): array
{ {
@ -46,7 +45,6 @@ class ServerDetailsController extends ApplicationApiController
* *
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function build(UpdateServerBuildConfigurationRequest $request, Server $server): array public function build(UpdateServerBuildConfigurationRequest $request, Server $server): array
{ {

View File

@ -50,7 +50,6 @@ class ServerManagementController extends ApplicationApiController
* *
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function reinstall(ServerWriteRequest $request, Server $server): Response public function reinstall(ServerWriteRequest $request, Server $server): Response
{ {

View File

@ -25,7 +25,6 @@ class StartupController extends ApplicationApiController
* @throws \Illuminate\Validation\ValidationException * @throws \Illuminate\Validation\ValidationException
* @throws \App\Exceptions\Http\Connection\DaemonConnectionException * @throws \App\Exceptions\Http\Connection\DaemonConnectionException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function index(UpdateServerStartupRequest $request, Server $server): array public function index(UpdateServerStartupRequest $request, Server $server): array
{ {

View File

@ -65,7 +65,6 @@ class UserController extends ApplicationApiController
* meta. If there are no errors this is an empty array. * meta. If there are no errors this is an empty array.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function update(UpdateUserRequest $request, User $user): array public function update(UpdateUserRequest $request, User $user): array
{ {

View File

@ -86,7 +86,6 @@ class DatabaseController extends ClientApiController
/** /**
* Removes a database from the server. * Removes a database from the server.
* *
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function delete(DeleteDatabaseRequest $request, Server $server, Database $database): Response public function delete(DeleteDatabaseRequest $request, Server $server, Database $database): Response
{ {

View File

@ -42,7 +42,6 @@ class NetworkAllocationController extends ClientApiController
* Set the primary allocation for a server. * Set the primary allocation for a server.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function update(UpdateAllocationRequest $request, Server $server, Allocation $allocation): array public function update(UpdateAllocationRequest $request, Server $server, Allocation $allocation): array
{ {
@ -66,7 +65,6 @@ class NetworkAllocationController extends ClientApiController
* Set the primary allocation for a server. * Set the primary allocation for a server.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function setPrimary(SetPrimaryAllocationRequest $request, Server $server, Allocation $allocation): array public function setPrimary(SetPrimaryAllocationRequest $request, Server $server, Allocation $allocation): array
{ {

View File

@ -97,7 +97,6 @@ class ScheduleController extends ClientApiController
* *
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function update(UpdateScheduleRequest $request, Server $server, Schedule $schedule): array public function update(UpdateScheduleRequest $request, Server $server, Schedule $schedule): array
{ {

View File

@ -94,7 +94,6 @@ class ScheduleTaskController extends ClientApiController
* Updates a given task for a server. * Updates a given task for a server.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function update(StoreTaskRequest $request, Server $server, Schedule $schedule, Task $task): array public function update(StoreTaskRequest $request, Server $server, Schedule $schedule, Task $task): array
{ {

View File

@ -47,7 +47,6 @@ class StartupController extends ClientApiController
* *
* @throws \Illuminate\Validation\ValidationException * @throws \Illuminate\Validation\ValidationException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function update(UpdateStartupVariableRequest $request, Server $server): array public function update(UpdateStartupVariableRequest $request, Server $server): array
{ {

View File

@ -81,7 +81,6 @@ class SubuserController extends ClientApiController
* Update a given subuser in the system for the server. * Update a given subuser in the system for the server.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function update(UpdateSubuserRequest $request, Server $server): array public function update(UpdateSubuserRequest $request, Server $server): array
{ {

View File

@ -31,7 +31,6 @@ class TwoFactorController extends ClientApiController
* will return a 400 error. * will return a 400 error.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function index(Request $request): JsonResponse public function index(Request $request): JsonResponse
{ {

View File

@ -23,8 +23,6 @@ class ServerInstallController extends Controller
/** /**
* Returns installation information for a server. * Returns installation information for a server.
*
* @throws RecordNotFoundException
*/ */
public function index(Request $request, string $uuid): JsonResponse public function index(Request $request, string $uuid): JsonResponse
{ {
@ -41,7 +39,6 @@ class ServerInstallController extends Controller
/** /**
* Updates the installation state of a server. * Updates the installation state of a server.
* *
* @throws \App\Exceptions\Repository\RecordNotFoundException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
*/ */
public function store(InstallationDataRequest $request, string $uuid): JsonResponse public function store(InstallationDataRequest $request, string $uuid): JsonResponse

View File

@ -69,7 +69,6 @@ class ResetPasswordController extends Controller
* @param string $password * @param string $password
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
protected function resetPassword($user, $password) protected function resetPassword($user, $password)
{ {

View File

@ -13,7 +13,6 @@ class EggExporterService
/** /**
* Return a JSON representation of an egg and its variables. * Return a JSON representation of an egg and its variables.
* *
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function handle(int $egg): string public function handle(int $egg): string
{ {

View File

@ -34,7 +34,6 @@ class VariableUpdateService
* *
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
* @throws \App\Exceptions\Service\Egg\Variable\ReservedVariableNameException * @throws \App\Exceptions\Service\Egg\Variable\ReservedVariableNameException
*/ */
public function handle(EggVariable $variable, array $data): mixed public function handle(EggVariable $variable, array $data): mixed

View File

@ -41,7 +41,6 @@ class ServerCreationService
* @throws \Throwable * @throws \Throwable
* @throws \App\Exceptions\DisplayException * @throws \App\Exceptions\DisplayException
* @throws \Illuminate\Validation\ValidationException * @throws \Illuminate\Validation\ValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
* @throws \App\Exceptions\Service\Deployment\NoViableNodeException * @throws \App\Exceptions\Service\Deployment\NoViableNodeException
* @throws \App\Exceptions\Service\Deployment\NoViableAllocationException * @throws \App\Exceptions\Service\Deployment\NoViableAllocationException
*/ */

View File

@ -25,7 +25,6 @@ class TwoFactorSetupService
* order to function. * order to function.
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
* @throws \App\Exceptions\Repository\RecordNotFoundException
*/ */
public function handle(User $user): array public function handle(User $user): array
{ {

View File

@ -8,7 +8,6 @@ use Mockery\MockInterface;
use App\Models\Node; use App\Models\Node;
use Illuminate\Contracts\Encryption\Encrypter; use Illuminate\Contracts\Encryption\Encrypter;
use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\HttpException;
use App\Exceptions\Repository\RecordNotFoundException;
use App\Http\Middleware\Api\Daemon\DaemonAuthenticate; use App\Http\Middleware\Api\Daemon\DaemonAuthenticate;
use App\Tests\Unit\Http\Middleware\MiddlewareTestCase; use App\Tests\Unit\Http\Middleware\MiddlewareTestCase;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;