Exception: Hpe3parSdk::HPE3PARException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/Hpe3parSdk/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code = nil, message = nil, ref = nil, http_status = nil) ⇒ HPE3PARException

Returns a new instance of HPE3PARException.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/Hpe3parSdk/exceptions.rb', line 16

def initialize(code = nil, message =nil, ref =nil, http_status=nil)
  @code = code
  @message = message
  @ref = ref
  @http_status = http_status
  formatted_string = 'Error: '
  if @http_status
    formatted_string += ' (HTTP %s)' % @http_status
  end
  if @code
    formatted_string += ' API code: %s' % @code
  end
  if @message
    formatted_string += ' - %s' % @message
  end
  if @ref
    formatted_string += ' - %s' % @ref
  end

  super(formatted_string)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



14
15
16
# File 'lib/Hpe3parSdk/exceptions.rb', line 14

def code
  @code
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



14
15
16
# File 'lib/Hpe3parSdk/exceptions.rb', line 14

def http_status
  @http_status
end

#messageObject (readonly)

Returns the value of attribute message.



14
15
16
# File 'lib/Hpe3parSdk/exceptions.rb', line 14

def message
  @message
end

#refObject (readonly)

Returns the value of attribute ref.



14
15
16
# File 'lib/Hpe3parSdk/exceptions.rb', line 14

def ref
  @ref
end