Exception: Vuzit::ClientException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/vuzitruby/client_exception.rb

Overview

Vuzit library exception handler class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, code = 0) ⇒ ClientException

Constructor for errors.



12
13
14
15
# File 'lib/vuzitruby/client_exception.rb', line 12

def initialize(message, code = 0)
  @message = message
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

The web service error code



9
10
11
# File 'lib/vuzitruby/client_exception.rb', line 9

def code
  @code
end

#messageObject (readonly)

The web service error message



6
7
8
# File 'lib/vuzitruby/client_exception.rb', line 6

def message
  @message
end

Instance Method Details

#to_sObject

Returns the string representation of the error in this format:



18
19
20
# File 'lib/vuzitruby/client_exception.rb', line 18

def to_s
  return "Vuzit::ClientException: [#{@code}]: #{@message}";
end