Class: Infusionsoft::ExceptionHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/infusionsoft/exception_handler.rb

Constant Summary collapse

ERRORS =
{
    1 => Infusionsoft::InvalidConfigError,
    2 => Infusionsoft::InvalidKeyError,
    3 => Infusionsoft::UnexpectedError,
    4 => Infusionsoft::DatabaseError,
    5 => Infusionsoft::RecordNotFoundError,
    6 => Infusionsoft::LoadingError,
    7 => Infusionsoft::NoTableAccessError,
    8 => Infusionsoft::NoFieldAccessError,
    9 => Infusionsoft::NoTableFoundError,
    10 => Infusionsoft::NoFieldFoundError,
    11 => Infusionsoft::NoFieldsError,
    12 => Infusionsoft::InvalidParameterError,
    13 => Infusionsoft::FailedLoginAttemptError,
    14 => Infusionsoft::NoAccessError,
    15 => Infusionsoft::FailedLoginAttemptPasswordExpiredError
}

Instance Method Summary collapse

Constructor Details

#initialize(xmlrpc_exception) ⇒ ExceptionHandler

Returns a new instance of ExceptionHandler.



23
24
25
26
27
28
29
30
# File 'lib/infusionsoft/exception_handler.rb', line 23

def initialize(xmlrpc_exception)
  error_class = ERRORS[xmlrpc_exception.faultCode]
  if error_class
    raise error_class, xmlrpc_exception.faultString
  else
    raise InfusionAPIError, xmlrpc_exception.faultString
  end
end