Exception: Rbeapi::Eapilib::CommandError

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

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

A CommandError exception is raised in response to an eAPI call that returns a failure message. 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 messsage to be raised

  • :commands (Array)

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


82
83
84
85
86
87
88
# File 'lib/rbeapi/eapilib.rb', line 82

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


68
69
70
# File 'lib/rbeapi/eapilib.rb', line 68

def error_code
  @error_code
end

#error_textObject (readonly)

Returns the value of attribute error_text


69
70
71
# File 'lib/rbeapi/eapilib.rb', line 69

def error_text
  @error_text
end