Exception: Rbeapi::Eapilib::CommandError

Inherits:
EapiError
  • Object
show all
Defined in:
lib/rbeapi/eapilib.rb

Overview

A CommandError exception is raised in response to an eAPI call that returns a failure message.

Instance Attribute Summary collapse

Attributes inherited from EapiError

#commands

Instance Method Summary collapse

Methods inherited from EapiError

#initalize

Constructor Details

#initialize(message, code, commands = nil) ⇒ CommandError

The exception contains the eAPI error code and error text.

Parameters:

  • message (String)

    The error message to return from raising this exception.

  • code (Integer)

    The error code associated with the error message to be raised.

  • commands (Array) (defaults to: nil)

    The list of commands that were used in the eAPI request message.



88
89
90
91
92
93
94
# File 'lib/rbeapi/eapilib.rb', line 88

def initialize(message, code, commands = nil)
  @error_code = code
  @error_text = message
  @commands = commands
  message = "Error [#{code}]: #{message}"
  super(message)
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



74
75
76
# File 'lib/rbeapi/eapilib.rb', line 74

def error_code
  @error_code
end

#error_textObject (readonly)

Returns the value of attribute error_text.



75
76
77
# File 'lib/rbeapi/eapilib.rb', line 75

def error_text
  @error_text
end