class HandleSystem::Error

A basic Exception class to wrap the handle server errors

@author David Walker

Attributes

handle[RW]

@return [String] the handle specified in the request

response_code[R]

@return [Intenger] handle protocol response code for the message

url[RW]

@return [String] the URL we sent that produced the error

Public Class Methods

new(response_code, message) click to toggle source

New Handle server Error

@param [Integer] response_code handle protocol response code for the message @param [String] message error message

Calls superclass method
# File lib/handle_system/exceptions.rb, line 25
def initialize(response_code, message)
  @response_code = response_code.to_int unless response_code.nil?
  super(message)
end
response_codes() click to toggle source

Handle server response codes / description

@return [Hash] in the form of code => description

# File lib/handle_system/exceptions.rb, line 35
def self.response_codes
  {
    2 => 'An unexpected error on the server',
    100 => 'Handle not found',
    101 => 'Handle already exists',
    102 => 'Invalid handle',
    200 => 'Values not found',
    201 => 'Value already exists',
    202 => 'Invalid value',
    301 => 'Server not responsible for handle',
    402 => 'Authentication needed'
  }
end