Open in playground
export const main = asl.deploy.asStateMachine(async (input: Input) =>
{
try {
throw new NotImplemented("not implemented")
} catch (err) {
if (err.Cause === "NotImplemented") {
return "Todo"
}
}
});
Open in playground
export const main = asl.deploy.asStateMachine(async (input: Input) =>
{
if (input.delayInSeconds > 10 || input.delayInSeconds < 1) {
throw new ValidationError("delay in seconds must be numeric value no greater than 10 and no smaller than 1")
}
throw new NotImplemented("not implemented")
});
Open in playground
export const main = asl.deploy.asStateMachine(async () =>
{
asl.parallel({
branches: [() => {
throw new RetryableError("retry me")
}],
retry: [{
errorEquals: ["RetryableError"],
backoffRate: 1.5,
intervalSeconds: 3,
maxAttempts: 2
}]
})
});
Open in playground
export const main = asl.deploy.asStateMachine(async () =>
{
asl.parallel({
branches: [() => {
throw new UnexpectedError("bad luck!")
}],
retry: [{
errorEquals: ["RetryableError"],
backoffRate: 1.5,
intervalSeconds: 3,
maxAttempts: 2
}],
catch: [{
errorEquals: ["UnexpectedError"],
block: (error) => {
console.log(`cause ${error.Cause}`)
console.log(`message ${error.Error}`)
}
}]
})
});