Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

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.

1public class MyFunctionInvocationError
2  implements functions.FunctionInvocationError {
3      public String getMessage() {
4          return 'Mock error message for testing';
5      }
6      public functions.FunctionErrorType getType() {
7          return functions.FunctionErrorType.FUNCTION_EXCEPTION;
8      }
9}

This example tests the implementation.

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