postInvocationError method

Future<Response> postInvocationError(
  1. String requestId,
  2. InvocationError err
)

Post an invocation error to the AWS Lambda Runtime Interface. It takes in an InvocationError and the requestId. The requestId is used to map the error to the execution.

Implementation

Future<http.Response> postInvocationError(
    String requestId, InvocationError err) async {
  return await _client.post(
    Uri.parse(
      'http://$runtimeApi/$runtimeApiVersion/runtime/invocation/$requestId/error',
    ),
    body: jsonEncode(err),
    headers: {'Content-type': 'application/json'},
  );
}