More work on the API utilizing Laravel 5.5 exception rendering

Also corrects API format to maintain JSONAPI spec
This commit is contained in:
Dane Everitt 2017-12-17 14:57:05 -06:00
parent f30f4b45ba
commit 54b6fb5ebd
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
28 changed files with 464 additions and 391 deletions

View file

@ -1,21 +1,20 @@
<?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\Repository;
class RecordNotFoundException extends \Exception
class RecordNotFoundException extends RepositoryException
{
/**
* @return int
* Handle request to render this exception to a user. Returns the default
* 404 page view.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function getStatusCode()
public function render($request)
{
return 404;
if (! config('app.debug')) {
return response()->view('errors.404', [], 404);
}
}
}