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
12 lines
217 B
Ruby
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
|