Sha256: 89d321f9e1107076422108bde6a4c4dc13a769180e71a6f9c1080b655a76ab02

Contents?: true

Size: 465 Bytes

Versions: 7

Compression:

Stored size: 465 Bytes

Contents

class UrlReader::BaseError < StandardError
  def self.msg(error, additional_msg = nil)
    msg = "#{error.class.name}: #{error.message}"
    if additional_msg
      msg += ", #{additional_msg}"
    end
    msg
  end

  def initialize(inner_or_msg = nil, additional_msg = nil)
    if inner_or_msg.is_a?(String)
      super(inner_or_msg)
    else
      super(self.class.msg(inner_or_msg, additional_msg))
      set_backtrace(inner_or_msg.backtrace)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
url_reader-0.2.5 lib/url_reader/base_error.rb
url_reader-0.2.4 lib/url_reader/base_error.rb
url_reader-0.2.3 lib/url_reader/base_error.rb
url_reader-0.2.2 lib/url_reader/base_error.rb
url_reader-0.2.1 lib/url_reader/base_error.rb
url_reader-0.2.0 lib/url_reader/base_error.rb
url_reader-0.1.0 lib/url_reader/base_error.rb