@session::reportFailure

Reports a failure to the handler script.

The $response.failure_type variable may contain any of the following failure types:

Syntax:

@session::reportFailure(long notificationId, String result)

Parameters:

Returns:

(Boolean) Returns false when the notificationId is invalid (which causes an error log message) or if the notification was for a user that has been delinked; otherwise, returns true.

Example:

This example illustrates the phone interaction script error handling, which reports the failure to the handler script, which in turn logs the reason for a notification failure.

Phone interaction script:

# --------------

# Error handlers

# --------------

PhoneHangupException:

$connected = false

IF (EXISTS($event.debug))

  @script::log($event.incident_id & ": Phone hangup exception.")

ENDIF

IF(!$reportedFailure)

  IF ($authenticated)

    $reportedFailure = @session::reportFailure($liveNotificationId, "USER_HUNG_UP_AFTER_AUTHENTICATION")

  ELSE

    $reportedFailure = @session::reportFailure($liveNotificationId, "USER_HUNG_UP")

  ENDIF

ENDIF

EXIT

Handler script:

IF ($response.response_event == "DEVICE_ATTEMPT_FAILURE")

   @script::log("Failure Type " & $response.failure_type)

ENDIF