Sha256: 9cdbb07e6a9e6d350d92c47289ee28de0b3d2e70f7e4336a34c9e5f6c8c63c85
Contents?: true
Size: 814 Bytes
Versions: 17
Compression:
Stored size: 814 Bytes
Contents
# frozen_string_literal: true module Grape module ErrorFormatter module Txt extend Base class << self def call(message, backtrace, options = {}, env = nil, original_exception = nil) message = present(message, env) result = message.is_a?(Hash) ? ::Grape::Json.dump(message) : message rescue_options = options[:rescue_options] || {} if rescue_options[:backtrace] && backtrace && !backtrace.empty? result += "\r\n backtrace:" result += backtrace.join("\r\n ") end if rescue_options[:original_exception] && original_exception result += "\r\n original exception:" result += "\r\n #{original_exception.inspect}" end result end end end end end
Version data entries
17 entries across 17 versions & 2 rubygems