The body of the catch
statement.
Even if the
catch
is triggered, and even if an exception is thrown in thecatch
, thefinally
will still be executed.
It can be an asynchronous function or a synchronous function.
Optional
finallyThe body of the finally
statement.
To avoid difficult-to-handle situations, ensure that the
finally
statement does not throw an exception. (But if thefinally
statement throws an exception, it can still be caught by the outertry-catch
.)Even if the
catch
is triggered, and even if an exception is thrown in thecatch
, thefinally
will still be executed.It must be a synchronous function.
The body of the try
statement.
It can be an asynchronous function or a synchronous function.
The options for the
try-catch[-finally]
expression.