Sha256: ad435eb5e06dcb2d89c4df67e5883e3f256b4982006304127924a0e593f0a561

Contents?: true

Size: 242 Bytes

Versions: 12

Compression:

Stored size: 242 Bytes

Contents

require 'rest_client'

module Kaui
  module ErrorHelper
    def as_string(e)
      if e.is_a?(RestClient::Exception)
        "#{e.message} #{e.response}".split(/\n/).take(5).join("\n")
      else
        e.message
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
kaui-0.2.2 lib/kaui/error_helper.rb
kaui-0.2.1 lib/kaui/error_helper.rb
kaui-0.2.0 lib/kaui/error_helper.rb
kaui-0.1.18 lib/kaui/error_helper.rb
kaui-0.1.17 lib/kaui/error_helper.rb
kaui-0.1.16 lib/kaui/error_helper.rb
kaui-0.1.15 lib/kaui/error_helper.rb
kaui-0.1.14 lib/kaui/error_helper.rb
kaui-0.1.12 lib/kaui/error_helper.rb
kaui-0.1.11 lib/kaui/error_helper.rb
kaui-0.1.10 lib/kaui/error_helper.rb
kaui-0.1.9 lib/kaui/error_helper.rb