Add (inspector)
Add (openai): debugging points for inspector
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
@@ -20,11 +22,54 @@ class Handler extends ExceptionHandler
|
||||
|
||||
/**
|
||||
* Register the exception handling callbacks for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register(): void
|
||||
public function register()
|
||||
{
|
||||
$this->reportable(function (Throwable $e) {
|
||||
$this->reportable(function (Throwable $exception) {
|
||||
//
|
||||
|
||||
});
|
||||
|
||||
$this->renderable(function (NotFoundHttpException $e, $request) {
|
||||
|
||||
|
||||
if ($request->is('api/*')) {
|
||||
return response()->json([
|
||||
'status' => -1,
|
||||
], 404);
|
||||
} else {
|
||||
return redirect()->route('front.home');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $exception
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render($request, Throwable $exception)
|
||||
{
|
||||
|
||||
if ($exception instanceof NotFoundHttpException)
|
||||
{
|
||||
|
||||
}
|
||||
else if ($exception instanceof AuthenticationException)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
inspector()->reportException($exception);
|
||||
}
|
||||
|
||||
//default laravel response
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user