Module: Morpho::Formatters::StandardError
- Defined in:
- app/api/morpho/formatters/standard_error.rb
Class Method Summary collapse
Class Method Details
.call(message, backtrace, options, env, original_exception) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/api/morpho/formatters/standard_error.rb', line 5 def call(, backtrace, , env, original_exception) if .is_a?(String) result = { message: , errors: [ { field_name: 'base', messages: [ ] } ] } elsif .is_a?(Hash) result = elsif .is_a?(Object) return .to_json if .respond_to?(:to_json) result = end ::Grape::Json.dump(result) end |