manifique/lib/manifique/errors.rb
Sebastian Kippe 4c36da46fe
Improve handling of failed requests
This adds a custom exception class with an error type that can be more
easily used by clients. It also explicitly handles failed connections as
such.

closes #9
2020-06-09 10:48:26 +02:00

12 lines
217 B
Ruby

module Manifique
class Error < ::StandardError
attr_reader :type, :url
def initialize(msg="Encountered an error", type="generic", url)
@type = type
@url = url
super(msg)
end
end
end