Class: Infuser::ExceptionHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/infuser/exceptions.rb

Constant Summary collapse

ERRORS =
{
  1  => Infuser::InvalidConfig,
  2  => Infuser::InvalidKey,
  3  => Infuser::UnexpectedError,
  4  => Infuser::DatabaseError,
  5  => Infuser::RecordNotFound,
  6  => Infuser::LoadingError,
  7  => Infuser::NoTableAccess,
  8  => Infuser::NoFieldAccess,
  9  => Infuser::NoTableFound,
  10 => Infuser::NoFieldFound,
  11 => Infuser::NoFieldsError,
  12 => Infuser::InvalidParameter,
  13 => Infuser::FailedLoginAttempt,
  14 => Infuser::NoAccess,
  15 => Infuser::FailedLoginAttemptPasswordExpired
}

Instance Method Summary collapse

Constructor Details

#initialize(xmlrpc_exception) ⇒ ExceptionHandler

Returns a new instance of ExceptionHandler.

Raises:

  • (error_class)


50
51
52
53
# File 'lib/infuser/exceptions.rb', line 50

def initialize xmlrpc_exception
  error_class = ERRORS[xmlrpc_exception.faultCode] || Infuser::Error
  raise error_class, xmlrpc_exception.faultString
end