Exception: HandleSystem::Error
- Inherits:
-
StandardError
- Object
- StandardError
- HandleSystem::Error
- Defined in:
- lib/handle_system/exceptions.rb
Overview
A basic Exception class to wrap the handle server errors
Instance Attribute Summary collapse
-
#handle ⇒ String
The handle specified in the request.
-
#response_code ⇒ Intenger
readonly
Handle protocol response code for the message.
-
#url ⇒ String
The URL we sent that produced the error.
Class Method Summary collapse
-
.response_codes ⇒ Hash
Handle server response codes / description.
Instance Method Summary collapse
-
#initialize(response_code, message) ⇒ Error
constructor
New Handle server Error.
Constructor Details
#initialize(response_code, message) ⇒ Error
New Handle server Error
25 26 27 28 |
# File 'lib/handle_system/exceptions.rb', line 25 def initialize(response_code, ) @response_code = response_code.to_int unless response_code.nil? super() end |
Instance Attribute Details
#handle ⇒ String
Returns the handle specified in the request.
14 15 16 |
# File 'lib/handle_system/exceptions.rb', line 14 def handle @handle end |
#response_code ⇒ Intenger (readonly)
Returns handle protocol response code for the message.
11 12 13 |
# File 'lib/handle_system/exceptions.rb', line 11 def response_code @response_code end |
#url ⇒ String
Returns the URL we sent that produced the error.
17 18 19 |
# File 'lib/handle_system/exceptions.rb', line 17 def url @url end |
Class Method Details
.response_codes ⇒ Hash
Handle server response codes / description
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# 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 |