Sha256: a9b64af148cb5275abe291ce74ecaee6243f4dcb0fb5a081f7cd8ddf3ef83e42

Contents?: true

Size: 510 Bytes

Versions: 8

Compression:

Stored size: 510 Bytes

Contents

module Grape
  module ErrorFormatter
    module Txt
      extend Base

      class << self
        def call(message, backtrace, options = {}, env = nil)
          message = 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

8 entries across 8 versions & 1 rubygems

Version Path
grape-0.19.2 lib/grape/error_formatter/txt.rb
grape-0.19.1 lib/grape/error_formatter/txt.rb
grape-0.19.0 lib/grape/error_formatter/txt.rb
grape-0.18.0 lib/grape/error_formatter/txt.rb
grape-0.17.0 lib/grape/error_formatter/txt.rb
grape-0.16.2 lib/grape/error_formatter/txt.rb
grape-0.16.1 lib/grape/error_formatter/txt.rb
grape-0.15.0 lib/grape/error_formatter/txt.rb