Module: Grape::ErrorFormatter::Json
- Defined in:
- lib/grape/error_formatter/json.rb
Class Method Summary collapse
Class Method Details
.call(message, backtrace, options = {}, env = nil) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/grape/error_formatter/json.rb', line 6 def call(, backtrace, = {}, env = nil) result = .is_a?(Hash) ? : { :error => } if ([:rescue_options] || {})[:backtrace] && backtrace && ! backtrace.empty? result = result.merge({ :backtrace => backtrace }) end MultiJson.dump(result) end |