title: Stop a view from being processed?
body: <p>In my controller I call this via an AJAX call:</p>
  
  <pre><code>$data = Lib::index();
      $view = View::make('index')
          -&gt;with('data', $data)
          -&gt;render();
      return $view;
  </code></pre>
  
  <p>The above fails because the correct table does not exist in my database.</p>
  
  <p>In Lib Index method, I catch this failure with:</p>
  
  <pre><code>catch (QueryException $e) {
  
      header('HTTP/1.0 404 Not found');
      exit;
  
  }
  </code></pre>
  
  <p>I catch the above error with the .fail deferred method of ajax call with jquery.</p>
  
  <p>All of the above works (and fails as expected) until I start calling the $data var in my view.</p>
  
  <p>Things like:</p>
  
  <pre><code>@foreach($data as $asset)
  </code></pre>
  
  <p>I get errors:</p>
  
  <pre><code>Trying to get property of non-object
  </code></pre>
  
  <p>But the view should not even be processed as the query error is caught.</p>
  
  <p>I've tried stuff like isset and isempty on teh data var in teh view, but it still processes the view.</p>
  
  <p>Why is the view still being processed and how can I stop it?</p>