mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-12 19:33:45 +02:00
More work on the API utilizing Laravel 5.5 exception rendering
Also corrects API format to maintain JSONAPI spec
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user