More work on the API utilizing Laravel 5.5 exception rendering
Also corrects API format to maintain JSONAPI spec
This commit is contained in:
parent
f30f4b45ba
commit
54b6fb5ebd
28 changed files with 464 additions and 391 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue