ts2asl icon indicating copy to clipboard operation
ts2asl copied to clipboard

support caught error to be rethrown

Open OlafConijn opened this issue 2 years ago • 0 comments

would be great to allow errors to be rethrown:

example:

export const main = asl.deploy.asStateMachine(async (input: Input) => {
  try {
    throw new RethrowMe("bad luck");
  } catch (err) {
    if (err.error === "Error") {
      throw err;
    }
  }
});

for now this seems not possible as the asl.fail state doesn't allow error or cause to be bound to a variable.

OlafConijn avatar Mar 27 '22 20:03 OlafConijn