title: Grape custom error with status code
body: <p>Hi I am working on rails project right now with Grape
  Basically I wanna make a custom error with grape since its supported.
  I have managed to create the custom error, something like this</p>
  
  <pre><code>module API
    module ErrorFormatter
      def self.call(message, backtrace, options, env)
        { :response_type =&gt; 'error', :details =&gt; message }.to_json
      end
    end
  end
  </code></pre>
  
  <p>it works fine, but What if I wanna add more details on it, like status code that we grape send/we manually pass on method <code>error!</code> so it would be have the status code on the json.</p>
  
  <p>it could be something like this</p>
  
  <pre><code>{ :status_code: *status_code_here*, :response_type =&gt; 'error', :details =&gt; message }
  </code></pre>
  
  <p>How do i set the value for <em>status_code_here</em></p>
  
  <p><strong>EDITED</strong></p>
  
  <p>This is in base/root for grape</p>
  
  <pre><code>  class Base &lt; Grape::API
      format :json
      error_formatter :json, API::ErrorFormatter
  
      mount API::V1::Base
    end
  </code></pre>
  
  <p>So it means now I am using the custom error instead of the pre-defined error of grape.
  This custom error will be invoked in two ways as I know:</p>
  
  <ol>
  <li>Grape automatically use this when you send a missing parameter on
  the API that you put the parameter as <code>requires</code></li>
  <li>When you explicitly call the <code>error!()</code> method as this <a href="https://github.com/intridea/grape#raising-exceptions" rel="nofollow">https://github.com/intridea/grape#raising-exceptions</a></li>
  </ol>
  
  <p>Any help?</p>
  
  <p>Thanks</p>