Exception: Grac::Exception::RequestFailed

Inherits:
StandardError
  • Object
show all
Defined in:
lib/grac/exception.rb

Direct Known Subclasses

ServiceTimeout

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, url, message) ⇒ RequestFailed

Returns a new instance of RequestFailed


34
35
36
37
38
# File 'lib/grac/exception.rb', line 34

def initialize(method, url, message)
  @method  = (method || "").upcase
  @url     = url
  @message = message
end

Instance Attribute Details

#methodObject (readonly)

Returns the value of attribute method


32
33
34
# File 'lib/grac/exception.rb', line 32

def method
  @method
end

#urlObject (readonly)

Returns the value of attribute url


32
33
34
# File 'lib/grac/exception.rb', line 32

def url
  @url
end

Instance Method Details

#inspectObject


44
45
46
# File 'lib/grac/exception.rb', line 44

def inspect
  "#{self.class.name}: #{message}"
end

#messageObject Also known as: to_s


40
41
42
# File 'lib/grac/exception.rb', line 40

def message
  "#{@method} '#{@url}' failed: #{@message}"
end