Throw 504 where necessary
This commit is contained in:
parent
d3f797bf2a
commit
4964d294f6
3 changed files with 12 additions and 2 deletions
|
@ -8,6 +8,9 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
|||
* Fixes a UI error when attempting to change the default Nest and Egg for an existing server.
|
||||
* Correct permissions check in UI to allow subusers with permission to `view-allocations` the ability to actually see the sidebar link.
|
||||
|
||||
### Changed
|
||||
* Panel now throws proper 504: Gateway Timeout errors on server listing when daemon is offline.
|
||||
|
||||
## v0.7.5 (Derelict Dermodactylus)
|
||||
### Fixed
|
||||
* Fixes application API keys being created as a client API key.
|
||||
|
|
|
@ -4,6 +4,8 @@ namespace Pterodactyl\Http\Controllers\Base;
|
|||
|
||||
use Illuminate\Http\Request;
|
||||
use Pterodactyl\Models\User;
|
||||
use Illuminate\Http\Response;
|
||||
use GuzzleHttp\Exception\ConnectException;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use Pterodactyl\Http\Controllers\Controller;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
|
@ -81,6 +83,8 @@ class IndexController extends Controller
|
|||
|
||||
try {
|
||||
$response = $this->daemonRepository->setServer($server)->setToken($token)->details();
|
||||
} catch (ConnectException $exception) {
|
||||
throw new HttpException(Response::HTTP_GATEWAY_TIMEOUT, $exception->getMessage());
|
||||
} catch (RequestException $exception) {
|
||||
throw new HttpException(500, $exception->getMessage());
|
||||
}
|
||||
|
|
|
@ -80,8 +80,11 @@
|
|||
}
|
||||
}
|
||||
}).fail(function (jqXHR) {
|
||||
console.error(jqXHR);
|
||||
element.find('[data-action="status"]').html('<span class="label label-default">Error</span>');
|
||||
if (jqXHR.status === 504) {
|
||||
element.find('[data-action="status"]').html('<span class="label label-default">Gateway Timeout</span>');
|
||||
} else {
|
||||
element.find('[data-action="status"]').html('<span class="label label-default">Error</span>');
|
||||
}
|
||||
});
|
||||
}).promise().done(function () {
|
||||
setTimeout(updateServerStatus, 10000);
|
||||
|
|
Loading…
Reference in a new issue