Sha256: d35774494a3b4ab120ffc1844b37a71664e042499ecb9f5ef4f59960810ff396

Contents?: true

Size: 492 Bytes

Versions: 1

Compression:

Stored size: 492 Bytes

Contents

module Grape
  module ErrorFormatter
    module Xml
      class << self

        def call(message, backtrace, options = {}, env = nil)
          result = message.is_a?(Hash) ? message : { message: message }
          if (options[:rescue_options] || {})[:backtrace] && backtrace && !backtrace.empty?
            result = result.merge(backtrace: backtrace)
          end
          result.respond_to?(:to_xml) ? result.to_xml(root: :error) : result.to_s
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grape-0.6.1 lib/grape/error_formatter/xml.rb