FunctionInvocationError Interface

Use FunctionInvocationError to get detailed error information about a failed Function invocation.

Namespace

functions

Usage

FunctionInvocationError contains various error information such as the error message at the time of the error.

FunctionInvocationError Methods

The following are methods for FunctionInvocationError.

getMessage()

Returns the error message from a Function invocation error.

Signature

public String getMessage()

Return Value

Type: String

getType()

Returns the error type for FunctionInvocationError.

Signature

public functions.FunctionErrorType getType()

Return Value

Type: functions.FunctionErrorType

FunctionInvocationError Example Implementation

This is an example implementation of the functions.FunctionInvocationError interface.

public class MyFunctionInvocationError
  implements functions.FunctionInvocationError {
      public String getMessage() {
          return 'Mock error message for testing';
      }
      public functions.FunctionErrorType getType() {
          return functions.FunctionErrorType.FUNCTION_EXCEPTION;
      }
}

This example tests the implementation.

functions.FunctionInvocationError testError = new MyFunctionInvocationError();
System.debug('Error: ' + testError.getMessage() + ' Type: ' + testError.getType());