private Continuable createContinuable(CpsThread currentThread, CpsCallableInvocation inv, BlockStartNode sn) {
// we need FunctionCallEnv that acts as the back drop of try/catch block.
// TODO: we need to capture the surrounding calling context to capture variables, and switch to ClosureCallEnv
FunctionCallEnv caller = new FunctionCallEnv(null, new SuccessAdapter(bodyExecution,sn), null, null);
if (currentThread.getExecution().isSandbox())
caller.setInvoker(new SandboxInvoker());
// catch an exception thrown from body and treat that as a failure
TryBlockEnv env = new TryBlockEnv(caller, null);
env.addHandler(Throwable.class, new FailureAdapter(bodyExecution,sn));