Exception: Distem::Lib::ClientError
- Inherits:
-
DistemError
- Object
- Exception
- DistemError
- Distem::Lib::ClientError
- Defined in:
- lib/distem/distemlib/errors.rb
Overview
An error occured when using the REST Client (see NetAPI::Client)
Instance Attribute Summary (collapse)
-
- (Object) body
readonly
Returns the value of attribute body.
-
- (Object) desc
readonly
Returns the value of attribute desc.
-
- (Object) num
readonly
Returns the value of attribute num.
Instance Method Summary (collapse)
-
- (ClientError) initialize(num = 0, desc = "", body = {})
constructor
A new instance of ClientError.
- - (Object) to_s
Constructor Details
- (ClientError) initialize(num = 0, desc = "", body = {})
Returns a new instance of ClientError
73 74 75 76 77 |
# File 'lib/distem/distemlib/errors.rb', line 73 def initialize(num = 0, desc = "", body = {}) @num = num @desc = desc @body = body end |
Instance Attribute Details
- (Object) body (readonly)
Returns the value of attribute body
72 73 74 |
# File 'lib/distem/distemlib/errors.rb', line 72 def body @body end |
- (Object) desc (readonly)
Returns the value of attribute desc
72 73 74 |
# File 'lib/distem/distemlib/errors.rb', line 72 def desc @desc end |
- (Object) num (readonly)
Returns the value of attribute num
72 73 74 |
# File 'lib/distem/distemlib/errors.rb', line 72 def num @num end |
Instance Method Details
- (Object) to_s
79 80 81 82 83 84 85 86 87 |
# File 'lib/distem/distemlib/errors.rb', line 79 def to_s if body.is_a?(Hash) or body.is_a?(Array) body = @body.inspect else body = @body end return "HTTP Status: #{@num},\nDescription: \"#{@desc}\",\nBody: #{body}\n" end |