Exception: OrganizationAudit::Repo::RequestError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/organization_audit/repo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, url = nil, code = 500, body = '') ⇒ RequestError

Returns a new instance of RequestError.



12
13
14
15
16
17
# File 'lib/organization_audit/repo.rb', line 12

def initialize(message, url=nil, code=500, body='')
  @url = url
  @code = Integer(code)
  @body = body
  super "#{message}\n#{url}\nCode: #{code}\n#{body}"
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



10
11
12
# File 'lib/organization_audit/repo.rb', line 10

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



10
11
12
# File 'lib/organization_audit/repo.rb', line 10

def code
  @code
end

#urlObject (readonly)

Returns the value of attribute url.



10
11
12
# File 'lib/organization_audit/repo.rb', line 10

def url
  @url
end