Exception: Cloudflare::RequestError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cloudflare/representation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request, value) ⇒ RequestError

Returns a new instance of RequestError.



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cloudflare/representation.rb', line 15

def initialize(request, value)
	if error = value[:error]
		super("#{request}: #{error}")
	elsif errors = value[:errors]
		super("#{request}: #{errors.map{|attributes| attributes[:message]}.join(', ')}")
	else
		super("#{request}: #{value.inspect}")
	end
	
	@value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



27
28
29
# File 'lib/cloudflare/representation.rb', line 27

def value
  @value
end