I am currently integrating some logic in App/Exceptions/Handler.php. I would like to be able to access the HTTP Status Code on the $exception variable:
public function report(Throwable $exception)
{
dd($exception->statusCode);
parent::report($exception);
}
However I get the following error:
ErrorException Undefined property: ErrorException::$statusCode
When I dd($exception) I get the following:
Symfony\Component\HttpKernel\Exception\NotFoundHttpException {#1214 ▼
-statusCode: 404
-headers: []
#message: ""
#code: 0
#file: "C:\Users\CEX\Documents\GitHub\unified\vendor\laravel\framework\src\Illuminate\Routing\AbstractRouteCollection.php"
#line: 43
trace: {▶}
}
How do I access the statusCode?