tryCatch function

Block tryCatch(
  1. Code tryBlock,
  2. Code catchBlock
)

Implementation

Block tryCatch(
  Code tryBlock,
  Code catchBlock,
) {
  return Block.of([
    const Code('try {'),
    tryBlock,
    const Code('} catch (e) {'),
    catchBlock,
    const Code('}'),
  ]);
}