mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 09:54:44 +02:00
Remove record not found exception
This commit is contained in:
parent
dece74c185
commit
1172fec6e5
@ -15,7 +15,6 @@ class DisableTwoFactorCommand extends Command
|
||||
* Handle command execution process.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@ -19,7 +18,6 @@ use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Symfony\Component\Mailer\Exception\TransportException;
|
||||
use App\Exceptions\Repository\RecordNotFoundException;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
|
||||
@ -40,7 +38,6 @@ class Handler extends ExceptionHandler
|
||||
AuthorizationException::class,
|
||||
HttpException::class,
|
||||
ModelNotFoundException::class,
|
||||
RecordNotFoundException::class,
|
||||
TokenMismatchException::class,
|
||||
ValidationException::class,
|
||||
];
|
||||
|
@ -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 [];
|
||||
}
|
||||
}
|
@ -22,7 +22,6 @@ class DynamicDatabaseConnection
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
|
@ -47,7 +47,6 @@ class DatabaseController extends Controller
|
||||
/**
|
||||
* Display database host to user.
|
||||
*
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function view(int $host): View
|
||||
{
|
||||
|
@ -40,7 +40,6 @@ class EggController extends Controller
|
||||
/**
|
||||
* Handle a request to display the Egg creation page.
|
||||
*
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function create(): View
|
||||
{
|
||||
@ -86,7 +85,6 @@ class EggController extends Controller
|
||||
* Handle request to update an Egg.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \App\Exceptions\Service\Egg\NoParentConfigurationFoundException
|
||||
*/
|
||||
public function update(EggFormRequest $request, Egg $egg): RedirectResponse
|
||||
|
@ -51,7 +51,6 @@ class EggScriptController extends Controller
|
||||
* Handle a request to update the installation script for an Egg.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function update(EggScriptFormRequest $request, Egg $egg): RedirectResponse
|
||||
{
|
||||
|
@ -25,9 +25,6 @@ class EggShareController extends Controller
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function export(Egg $egg): Response
|
||||
{
|
||||
$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.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \App\Exceptions\Service\Egg\BadJsonFormatException
|
||||
* @throws \App\Exceptions\Service\InvalidFileUploadException
|
||||
*/
|
||||
@ -60,7 +56,6 @@ class EggShareController extends Controller
|
||||
* Update an existing Egg using a new imported file.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \App\Exceptions\Service\Egg\BadJsonFormatException
|
||||
* @throws \App\Exceptions\Service\InvalidFileUploadException
|
||||
*/
|
||||
|
@ -56,7 +56,6 @@ class EggVariableController extends Controller
|
||||
*
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \App\Exceptions\Service\Egg\Variable\ReservedVariableNameException
|
||||
*/
|
||||
public function update(EggVariableFormRequest $request, Egg $egg, EggVariable $variable): RedirectResponse
|
||||
|
@ -38,7 +38,6 @@ class MountController extends Controller
|
||||
/**
|
||||
* Return the mount view page.
|
||||
*
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function view(string $id): View
|
||||
{
|
||||
|
@ -66,7 +66,6 @@ class NodesController extends Controller
|
||||
*
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function allocationSetAlias(AllocationAliasFormRequest $request): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
|
@ -27,7 +27,6 @@ class CreateServerController extends Controller
|
||||
/**
|
||||
* Displays the create server page.
|
||||
*
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function index(): View|RedirectResponse
|
||||
{
|
||||
|
@ -59,7 +59,6 @@ class ServerViewController extends Controller
|
||||
/**
|
||||
* Returns the server startup management page.
|
||||
*
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function startup(Request $request, Server $server): View
|
||||
{
|
||||
|
@ -53,7 +53,6 @@ class ServersController extends Controller
|
||||
* Update the details for a server.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function setDetails(Request $request, Server $server): RedirectResponse
|
||||
{
|
||||
@ -71,7 +70,6 @@ class ServersController extends Controller
|
||||
*
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function toggleInstall(Server $server): RedirectResponse
|
||||
{
|
||||
@ -92,7 +90,6 @@ class ServersController extends Controller
|
||||
*
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function reinstallServer(Server $server): RedirectResponse
|
||||
{
|
||||
@ -107,7 +104,6 @@ class ServersController extends Controller
|
||||
*
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function manageSuspension(Request $request, Server $server): RedirectResponse
|
||||
{
|
||||
@ -123,7 +119,6 @@ class ServersController extends Controller
|
||||
* Update the build configuration for a server.
|
||||
*
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function updateBuild(Request $request, Server $server): RedirectResponse
|
||||
|
@ -45,7 +45,6 @@ class AdvancedController extends Controller
|
||||
|
||||
/**
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function update(AdvancedSettingsFormRequest $request): RedirectResponse
|
||||
{
|
||||
|
@ -43,7 +43,6 @@ class IndexController extends Controller
|
||||
* Handle settings update.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function update(BaseSettingsFormRequest $request): RedirectResponse
|
||||
{
|
||||
|
@ -46,7 +46,6 @@ class MailController extends Controller
|
||||
*
|
||||
* @throws DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function update(MailSettingsFormRequest $request): Response
|
||||
{
|
||||
|
@ -114,7 +114,6 @@ class UserController extends Controller
|
||||
* Update a user on the system.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function update(UserFormRequest $request, User $user): RedirectResponse
|
||||
{
|
||||
|
@ -49,7 +49,6 @@ class ServerController extends ApplicationApiController
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \App\Exceptions\Service\Deployment\NoViableAllocationException
|
||||
* @throws \App\Exceptions\Service\Deployment\NoViableNodeException
|
||||
*/
|
||||
|
@ -27,7 +27,6 @@ class ServerDetailsController extends ApplicationApiController
|
||||
*
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function details(UpdateServerDetailsRequest $request, Server $server): array
|
||||
{
|
||||
@ -46,7 +45,6 @@ class ServerDetailsController extends ApplicationApiController
|
||||
*
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function build(UpdateServerBuildConfigurationRequest $request, Server $server): array
|
||||
{
|
||||
|
@ -50,7 +50,6 @@ class ServerManagementController extends ApplicationApiController
|
||||
*
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function reinstall(ServerWriteRequest $request, Server $server): Response
|
||||
{
|
||||
|
@ -25,7 +25,6 @@ class StartupController extends ApplicationApiController
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
* @throws \App\Exceptions\Http\Connection\DaemonConnectionException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function index(UpdateServerStartupRequest $request, Server $server): array
|
||||
{
|
||||
|
@ -65,7 +65,6 @@ class UserController extends ApplicationApiController
|
||||
* meta. If there are no errors this is an empty array.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function update(UpdateUserRequest $request, User $user): array
|
||||
{
|
||||
|
@ -86,7 +86,6 @@ class DatabaseController extends ClientApiController
|
||||
/**
|
||||
* Removes a database from the server.
|
||||
*
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function delete(DeleteDatabaseRequest $request, Server $server, Database $database): Response
|
||||
{
|
||||
|
@ -42,7 +42,6 @@ class NetworkAllocationController extends ClientApiController
|
||||
* Set the primary allocation for a server.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function setPrimary(SetPrimaryAllocationRequest $request, Server $server, Allocation $allocation): array
|
||||
{
|
||||
|
@ -97,7 +97,6 @@ class ScheduleController extends ClientApiController
|
||||
*
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function update(UpdateScheduleRequest $request, Server $server, Schedule $schedule): array
|
||||
{
|
||||
|
@ -94,7 +94,6 @@ class ScheduleTaskController extends ClientApiController
|
||||
* Updates a given task for a server.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function update(StoreTaskRequest $request, Server $server, Schedule $schedule, Task $task): array
|
||||
{
|
||||
|
@ -47,7 +47,6 @@ class StartupController extends ClientApiController
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function update(UpdateStartupVariableRequest $request, Server $server): array
|
||||
{
|
||||
|
@ -81,7 +81,6 @@ class SubuserController extends ClientApiController
|
||||
* Update a given subuser in the system for the server.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function update(UpdateSubuserRequest $request, Server $server): array
|
||||
{
|
||||
|
@ -31,7 +31,6 @@ class TwoFactorController extends ClientApiController
|
||||
* will return a 400 error.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
|
@ -23,8 +23,6 @@ class ServerInstallController extends Controller
|
||||
|
||||
/**
|
||||
* Returns installation information for a server.
|
||||
*
|
||||
* @throws RecordNotFoundException
|
||||
*/
|
||||
public function index(Request $request, string $uuid): JsonResponse
|
||||
{
|
||||
@ -41,7 +39,6 @@ class ServerInstallController extends Controller
|
||||
/**
|
||||
* Updates the installation state of a server.
|
||||
*
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
*/
|
||||
public function store(InstallationDataRequest $request, string $uuid): JsonResponse
|
||||
|
@ -69,7 +69,6 @@ class ResetPasswordController extends Controller
|
||||
* @param string $password
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
protected function resetPassword($user, $password)
|
||||
{
|
||||
|
@ -13,7 +13,6 @@ class EggExporterService
|
||||
/**
|
||||
* Return a JSON representation of an egg and its variables.
|
||||
*
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function handle(int $egg): string
|
||||
{
|
||||
|
@ -34,7 +34,6 @@ class VariableUpdateService
|
||||
*
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \App\Exceptions\Service\Egg\Variable\ReservedVariableNameException
|
||||
*/
|
||||
public function handle(EggVariable $variable, array $data): mixed
|
||||
|
@ -41,7 +41,6 @@ class ServerCreationService
|
||||
* @throws \Throwable
|
||||
* @throws \App\Exceptions\DisplayException
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \App\Exceptions\Service\Deployment\NoViableNodeException
|
||||
* @throws \App\Exceptions\Service\Deployment\NoViableAllocationException
|
||||
*/
|
||||
|
@ -25,7 +25,6 @@ class TwoFactorSetupService
|
||||
* order to function.
|
||||
*
|
||||
* @throws \App\Exceptions\Model\DataValidationException
|
||||
* @throws \App\Exceptions\Repository\RecordNotFoundException
|
||||
*/
|
||||
public function handle(User $user): array
|
||||
{
|
||||
|
@ -8,7 +8,6 @@ use Mockery\MockInterface;
|
||||
use App\Models\Node;
|
||||
use Illuminate\Contracts\Encryption\Encrypter;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use App\Exceptions\Repository\RecordNotFoundException;
|
||||
use App\Http\Middleware\Api\Daemon\DaemonAuthenticate;
|
||||
use App\Tests\Unit\Http\Middleware\MiddlewareTestCase;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
|
Loading…
x
Reference in New Issue
Block a user