Exception: Nexpose::APIError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/nexpose/error.rb

Direct Known Subclasses

AuthenticationFailed, PermissionError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(req, reason = '', code = 400) ⇒ APIError

Returns a new instance of APIError.



6
7
8
9
10
# File 'lib/nexpose/error.rb', line 6

def initialize(req, reason = '', code = 400)
  @req = req
  @reason = reason
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/nexpose/error.rb', line 4

def code
  @code
end

#reasonObject

Returns the value of attribute reason.



3
4
5
# File 'lib/nexpose/error.rb', line 3

def reason
  @reason
end

#reqObject

Returns the value of attribute req.



3
4
5
# File 'lib/nexpose/error.rb', line 3

def req
  @req
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/nexpose/error.rb', line 12

def to_s
  "NexposeAPI: #{@reason}"
end