mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Fixed weird status code error on ajax
This commit is contained in:
parent
b019e6e950
commit
8f0ab1e719
|
@ -63,9 +63,11 @@ class Handler extends ExceptionHandler
|
|||
|
||||
if ($this->isHttpException($e)) {
|
||||
|
||||
$statusCode = $e->getStatusCode();
|
||||
|
||||
switch ($e->getStatusCode()) {
|
||||
case '404':
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, $statusCode . ' not found'), 404);
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, $statusCode . ' endpoint not found'), 404);
|
||||
break;
|
||||
case '405':
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, 'Method not allowed'), 405);
|
||||
|
@ -79,17 +81,10 @@ class Handler extends ExceptionHandler
|
|||
}
|
||||
|
||||
|
||||
if ($this->isHttpException($e)) {
|
||||
|
||||
$statusCode = $e->getStatusCode();
|
||||
|
||||
switch ($statusCode) {
|
||||
|
||||
case '404':
|
||||
return response()->view('layouts/basic', [
|
||||
'content' => view('errors/404')
|
||||
]);
|
||||
}
|
||||
if ($this->isHttpException($e) && (isset($statusCode)) && ($statusCode == '404' )) {
|
||||
return response()->view('layouts/basic', [
|
||||
'content' => view('errors/404')
|
||||
]);
|
||||
}
|
||||
|
||||
return parent::render($request, $e);
|
||||
|
|
Loading…
Reference in a new issue