stop_decomposition: Raise an error with a request ID if known

View source: R/error-handling.R

stop_decompositionR Documentation

Raise an error with a request ID if known

Description

During decomposition from an invocation into an event, it is possible for an error to occur when a request ID is known but the event hasn't been fully realised yet. In order to handle these, an error must be posted to the invocation error endpoint.

stop_decomposition raises an error with an optional request_id. The error can then be processed by handle_decomposition_error. If a request_id is present then the error can be posted to the invocation error endpoint. Otherwise, the error is simply logged. In either case the error does not stop the kernel, and the runtime can move onto the next event.

handle_decomposition_error accepts a config object, created through the lambda_config function. It returns a function that accepts an error e, which means that handle_decomposition_error(event) can be passed as a value to the tryCatch error argument.

Usage

stop_decomposition(..., request_id = NULL)

handle_decomposition_error(config)

Arguments

...

zero or more objects which can be coerced to character (and which are pasted together with no separator). This forms the error message.

request_id

character. Used in error handling during event decomposition, when it's possible that a request ID might be known but the event hasn't been fully examined yet.


lambdr documentation built on Nov. 25, 2023, 5:08 p.m.