> ## Documentation Index
> Fetch the complete documentation index at: https://acme-c84a37e5.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Migración

> De try/catch y Promise.all a resultados seguros y controlados

## De try/catch a `run`

```typescript theme={null}
import { run } from "tryo";

const r = await run(() => fetch("/api").then((x) => x.json()));
if (r.ok) {
  console.log(r.data);
} else {
  console.error(r.error.code);
}
```

## De `Promise.all` a `all`

```typescript theme={null}
import { all } from "tryo";

const tasks = [() => fetch("/a"), () => fetch("/b")];
const results = await all<Response>(tasks, {
  concurrency: 2,
  mode: "settle",
});
```
