What should return the Grape rescue_from :all block?
<p>The Grape documentation says that:<br>
<code>The rescue_from block must return a Rack::Response object, call error! or re-raise an exception.</code></p>

<p>but if we use the <code>rescue_from</code> method only to log things and we want to keep the original HTTP answer what should we return ?</p>

<p>If I rethrow the catched exception, it does not keep the original behavior. 
For example, some of my tests generate <code>400</code> responses but with: </p>

<pre><code>rescue_from :all do |e|
  Rails.logger.error(e)
  raise e
end
</code></pre>

<p>They catch <code>500</code> responses.</p>

<p>The better solution I found to reproduce the original behavior is this code:</p>

<pre><code>rescue_from :all do |e|
  Rails.logger.error(e)
  if e.respond_to?(:status)
    error!(e.to_json, e.status, e.headers, e.backtrace)
  else
    error! "Internal Server Error"
  end
end
</code></pre>

<p>I should check if the catched exception responds to <code>status</code> because it could be a RuntimeError for example, and RuntimeError does not answer to <code>status</code>.</p>

<p>Am I doing this right ? Or there is a better solution to do that ?</p>