TryStatement
A try statement.
import { TryStatement } from "@alloy-js/typescript";
<TryStatement > {children}</TryStatement>import { TryStatement } from "@alloy-js/typescript/stc";
TryStatement({ }).children(children)| children | Children |
Example
Section titled “Example”<TryStatement>
// risky operation
</TryStatement>
<CatchClause parameter="error">
console.error(error);
</CatchClause>
renders to
try {
// risky operation
} catch (error) {
console.error(error);
}