error result

Contains error information that relates to a previous response from an application.

Used in HTTP Request

language wrappers and examples

It contains the following properties:

PropertyAvailabilityDescription
action indexgenerallyA zero-based index identifying the specific action that generated this result within the list of actions. This will not be present if the error is generated before any actions are interpreted from the response.
actiongenerallyThe name of the action that generated this result. This will not be present if the error is generated before any actions are interpreted from the response.
resultalwaysA string that contains an error description.

  • Examples:


    • The error result of a play action:

      	{
      		"action_index" : 1,
      		"action" : "play",
      		"result" : "The file to play - nonexistent.wav - does not exist."
      	}
      
  • ErrorResult Class
    Namespace: Aculab.Cloud.RestAPIWrapper
    Assembly: Aculab.Cloud.RestAPIWrapper.dll

    A class representing an error result relating to to a previous response.

    • public class ErrorResult 
      {
          // Members
          public int ActionIndex;
          public string Action;
          public string Result;
      }
      

      Examples:

      • Get the error information:

        var instanceInfo = new TelephonyRequest(Request).InstanceInfo;
        var token = instanceInfo.Token;
        var errorResult = instanceInfo.ErrorResult;
        var actionIndex = errorResult.ActionIndex;
        var action = errorResult.Action;
        var result = errorResult.Result;
        
    • public class ErrorResult 
      {
          // Members
          public int ActionIndex;
          public string Action;
          public string Result;
      }
      

      Examples:

      • Get the error information:

        var instanceInfo = new TelephonyRequest(Request).InstanceInfo;
        var token = instanceInfo.Token;
        var errorResult = instanceInfo.ErrorResult;
        var actionIndex = errorResult.ActionIndex;
        var action = errorResult.Action;
        var result = errorResult.Result;
        
    • public class ErrorResult 
      {
          // Members
          public int ActionIndex;
          public string Action;
          public string Result;
      }
      

      Examples:

      • Get the error information:

        var telephonyRequest = await TelephonyRequest.UnpackRequestAsync(Request);
        var token = instanceInfo.Token;
        var errorResult = instanceInfo.ErrorResult;
        var actionIndex = errorResult.ActionIndex;
        var action = errorResult.Action;
        var result = errorResult.Result;
        
  • ErrorResult Class
    Namespace: Aculab.Cloud.RestAPIWrapper
    Assembly: Aculab.Cloud.RestAPIWrapper.dll

    A class representing an error result relating to to a previous response.

    • Public Class ErrorResult
          ' Members
          Public Property ActionIndex As Integer
          Public Property Action As String
          Public Property Result As String
      End Class
      

      Examples:

      • Get the error information:

        Dim instanceInfo = New TelephonyRequest(Request).InstanceInfo
        Dim token = instanceInfo.Token
        Dim errorResult = instanceInfo.ErrorResult
        Dim actionIndex = errorResult.ActionIndex
        Dim action = errorResult.Action
        Dim result = errorResult.Result
        
    • Public Class ErrorResult
          ' Members
          Public Property ActionIndex As Integer
          Public Property Action As String
          Public Property Result As String
      End Class
      

      Examples:

      • Get the error information:

        Dim instanceInfo = New TelephonyRequest(Request).InstanceInfo
        Dim token = instanceInfo.Token
        Dim errorResult = instanceInfo.ErrorResult
        Dim actionIndex = errorResult.ActionIndex
        Dim action = errorResult.Action
        Dim result = errorResult.Result
        
  • class ErrorResult

    A class representing an error result relating to to a previous response.

    Class synopsis:

    // Members:
    public final String getAction()
    public final long getActionIndex()
    public final String getResult()
    

    Examples:

    • Get the error information:

      TelephonyRequest myRequest = new TelephonyRequest(request);
      ErrorResult errorRes = myRequest.getInstanceInfo().getErrorResult();
      
      long actionIndex = errorRes.getActionIndex();
      String action = errorRes.getAction();
      String result = errorRes.getResult();
      
  • TelephonyRequest.get_error_result()

    Returns a dictionary that represents a Error Result support class.

    Examples:

    • Get the error information:

      my_request = TelephonyRequest(request)
      error_result = my_request.get_error_result()
      
      err_res = error_result.get("result")
      err_action = error_result.get("action", "?")
      err_action_index = error_result.get("action_index", "?")
      
  • The ErrorResult class

    Introduction

    Represents information about an error.

    getResult() will return an empty string if no result string was specified in the request. getAction() will return null if no action was specified in the request. getActionIndex() will return null if no action index was specified in the request.

    Class synopsis

    class ErrorResult extends PropertyHolder {
    
        /* methods */
        public string getResult()
        public string getAction()
        public int getActionIndex()
    }
    

    Examples:

    • Get the error information:

      $info = InstanceInfo::getInstanceInfo();
      $token = $info->getToken();
      $error_result = $info->getErrorResult();
      $action_index = $error_result->getActionIndex();
      $action = $error_result->getAction();
      $result = $error_result->getResult();