getExecutionContext<T extends FExecutionContext> static method

  1. @protected
T getExecutionContext<T extends FExecutionContext>(
  1. FExecutionContext context
)

Obtain a closest instance of typed FExecutionContext that encloses the given context.

Raise FExceptionInvalidOperation if requested type not found

Implementation

@protected
static T getExecutionContext<T extends FExecutionContext>(
  final FExecutionContext context,
) {
  final T? chainItem = FExecutionContext.findExecutionContext<T>(context);

  if (chainItem != null) {
    return chainItem;
  }

  throw FExceptionInvalidOperation(
      "Execution context '$T' is not presented on the chain.");
}