title: How do I get the HTTP Status Code from an Exception thrown in Laravel?
body: <p>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:</p>
  <pre><code>public function report(Throwable $exception)
  {
      dd($exception-&gt;statusCode);
      parent::report($exception);
  }
  </code></pre>
  <p>However I get the following error:</p>
  <blockquote>
  <p>ErrorException Undefined property: ErrorException::$statusCode</p>
  </blockquote>
  <p>When I <code>dd($exception)</code> I get the following:</p>
  <pre><code>Symfony\Component\HttpKernel\Exception\NotFoundHttpException {#1214 ▼
    -statusCode: 404
    -headers: []
    #message: &quot;&quot;
    #code: 0
    #file: &quot;C:\Users\CEX\Documents\GitHub\unified\vendor\laravel\framework\src\Illuminate\Routing\AbstractRouteCollection.php&quot;
    #line: 43
    trace: {▶}
  }
  </code></pre>
  <p>How do I access the <code>statusCode</code>?</p>