# TryStatement

A try statement.

* jsx

  ```tsx
  import { TryStatement } from "@alloy-js/typescript";


  <TryStatement >
    {children}
  </TryStatement>
  ```

* stc

  ```ts
  import { TryStatement } from "@alloy-js/typescript/stc";


  TryStatement({  }).children(children)
  ```

## Props

|          |                                           |   |
| -------- | ----------------------------------------- | - |
| children | [Children](../../../core/types/children/) |   |

## Example

```tsx
<TryStatement>
  // risky operation
</TryStatement>
<CatchClause parameter="error">
  console.error(error);
</CatchClause>
```

renders to

```ts
try {
  // risky operation
} catch (error) {
  console.error(error);
}
```
