mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 14:53:45 +02:00
Finish first round of User/Node API additions
Will still need some tweaking and improvements to allow everything to be used.
This commit is contained in:
@@ -11,6 +11,7 @@ namespace Pterodactyl\Exceptions;
|
||||
|
||||
use Log;
|
||||
use Throwable;
|
||||
use Illuminate\Http\Response;
|
||||
use Prologue\Alerts\AlertsMessageBag;
|
||||
|
||||
class DisplayException extends PterodactylException
|
||||
@@ -65,7 +66,7 @@ class DisplayException extends PterodactylException
|
||||
if ($request->expectsJson()) {
|
||||
return response()->json(Handler::convertToArray($this, [
|
||||
'detail' => $this->getMessage(),
|
||||
]), method_exists($this, 'getStatusCode') ? $this->getStatusCode() : 500);
|
||||
]), method_exists($this, 'getStatusCode') ? $this->getStatusCode() : Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
app()->make(AlertsMessageBag::class)->danger($this->getMessage())->flash();
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Pterodactyl - Panel
|
||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||
*
|
||||
* This software is licensed under the terms of the MIT license.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
namespace Pterodactyl\Exceptions\Service;
|
||||
|
||||
use Illuminate\Http\Response;
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
|
||||
class HasActiveServersException extends DisplayException
|
||||
{
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getStatusCode()
|
||||
{
|
||||
return Response::HTTP_BAD_REQUEST;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Pterodactyl - Panel
|
||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||
*
|
||||
* This software is licensed under the terms of the MIT license.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
namespace Pterodactyl\Exceptions\Service\Location;
|
||||
|
||||
use Illuminate\Http\Response;
|
||||
use Pterodactyl\Exceptions\DisplayException;
|
||||
|
||||
class HasActiveNodesException extends DisplayException
|
||||
{
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getStatusCode()
|
||||
{
|
||||
return Response::HTTP_BAD_REQUEST;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user