Sha256: 39f73fa7983eb11bfd0175568d240ed75097e5dcfba1a3505cf61f761e6ca34b

Contents?: true

Size: 519 Bytes

Versions: 7

Compression:

Stored size: 519 Bytes

Contents

module Grape
  module ErrorFormatter
    module Txt
      class << self
        def call(message, backtrace, options = {}, env = nil)
          message = Grape::ErrorFormatter::Base.present(message, env)

          result = message.is_a?(Hash) ? MultiJson.dump(message) : message
          if (options[:rescue_options] || {})[:backtrace] && backtrace && !backtrace.empty?
            result += "\r\n "
            result += backtrace.join("\r\n ")
          end
          result
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
grape-0.14.0 lib/grape/error_formatter/txt.rb
grape-0.13.0 lib/grape/error_formatter/txt.rb
grape-0.12.0 lib/grape/error_formatter/txt.rb
grape-0.11.0 lib/grape/error_formatter/txt.rb
grape-0.10.1 lib/grape/error_formatter/txt.rb
grape-0.10.0 lib/grape/error_formatter/txt.rb
grape-0.9.0 lib/grape/error_formatter/txt.rb