title: NotFoundHttpException is not catched in controller with Lumen 5.6
body: <p>I want to manage 404 error with a custom json response.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>try {
              $registration = Registration::find($id);
              if ($registration == null) throw new NotFoundHttpException();
              return response()-&gt;json($registration, HttpResponse::HTTP_OK);
          } catch (NotFoundHttpException $e) {
              return response()-&gt;json(['message' =&gt; 'Registration not found'], HttpResponse::HTTP_NOT_FOUND);
          }
  </code></pre>
  
  <p>but it nevers enter in the catch block, and return a HTML view :</p>
  
  <pre><code>Sorry, the page you are looking for could not be found.
  
  (1/1) NotFoundHttpException
  in RoutesRequests.php line 226
  at Application-&gt;handleDispatcherResponse(array(0))
  in RoutesRequests.php line 164
  at Application-&gt;Laravel\Lumen\Concerns\{closure}()
  in RoutesRequests.php line 413
  at Application-&gt;sendThroughPipeline(array(), object(Closure))
  in RoutesRequests.php line 166
  at Application-&gt;dispatch(null)
  in RoutesRequests.php line 107
  at Application-&gt;run()
  in index.php line 28
  at require('/Users/julien/Documents/Proyectos/jaumo/public/index.php')
  in server.php line 147
  </code></pre>
  
  <p>I also tried with <code>Registration::findOrFail($id);</code> which is supposed to return 40 error, but it is the same result</p>
  
  <p>I could change it in <code>Handler.php</code> :</p>
  
  <pre><code>public function render($request, Exception $e)
      {
          if ($e instanceof NotFoundHttpException) {
              return response()-&gt;json('Not Found', HttpResponse::HTTP_NOT_FOUND);
          }
          return parent::render($request, $e);
      }
  </code></pre>
  
  <p>but this is not quite what I want, here the message is static, I would like to manage it in controller.</p>
  
  <p>I also tried to add <code>NotFoundHttpException::class</code> to $dontReport array, but it is not working</p>
  
  <p>Why, and how can I do just to return a custom json response.</p>