Avaya Client SDK

< Back to Package Overview

SDK Operations

SDK Properties

client.version;     // version of the JavaScript SDK

Error Handling

To see if an error is being raised a callback can be added to the clientSession object. The error object that is returned will contain information on the details, type and severity of the error being raised.

The callback can be added as such:

    clientSession.addOnErrorCallback(function (error) {
        console.log(error);
    });

Logging SDK Events

The easiest way to log SDK events is to use the browser's native console API by implementing the following in your code

client.registerLogger(console);

Logger will then be executed internally in the SDK. The Customer Interaction Services Client SDK package for JavaScript uses 5 different logging levels.

  • Error: Client.Base.Logger.error('error message'); The execution of some task could not be completed (e.g. an email couldn't be sent, a page couldn't be rendered).
  • Warn: Client.Base.Logger.warn('warning message'); Something unexpected happened, but that execution can continue, perhaps in a degraded mode (e.g. a configuration file was missing but defaults were used). Warnings are often a sign that there will be an error very soon.
  • Info: Client.Base.Logger.info('info message'); Something normal but significant happened (e.g. system started, user logged in). Typical business exceptions can go here (e.g. login failed due to bad credentials).
  • Log: Client.Base.Logger.log('log message'); Logic information (e.g. result of an if statement)
  • Debug: Client.Base.Logger.debug('debug message');

Error Codes

Type Name Description
badRequest 400000 Validation failed
unauthorized 401000 No Authorization header
unauthorized 401001 Invalid authorization schema
unauthorized 401002 Invalid token
unauthorized 401003 Invalid username or password from authentication provider
unauthorized 401004 Could not get authentication enabled property from properties
unauthorized 401005 Invalid claims in token
unauthorized 401006 Authentication provider not found
unauthorized 401007 An internal error occurred for the authentication provider
unauthorized 401008 Authentication provider is incorrectly configured
unauthorized 401009 Authentication provider could not find Oceana user
unauthorized 401010 Authentication provider returned unexpected status code
unauthorized 401011 Could not communicate with Authentication provider
forbidden 403000 Access denied. Not authorised.
forbidden 403001 HTTPS required
notFound 404000 UserDetails not found
notFound 404001 UserProfile not found
notFound 404002 UserSession not found
notFound 404003 UserState not found
notFound 404004 AuthenticationServerUser not found
notFound 404005 UserProfileAccount not found
notFound 404006 Resource not found
notFound 404007 ClientSession not found
notFound 404008 Account not found
notFound 404009 Interaction not found
internal 500000 Internal Error