[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Result](https://evolu.dev/docs/api-reference/common/Result) › getOrThrow

```ts
function getOrThrow<T, E>(result: Result<T, E>): T;
```

Defined in: [packages/common/src/Result.ts:351](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Result.ts#L351)

Returns the value from an `Ok` [Result](https://evolu.dev/docs/api-reference/common/Result/type-aliases/Result), or throws if it is an `Err`.

Use this where failure should crash the current flow instead of being handled
locally.

**When to use:**

- Application startup or composition-root setup where errors must stop the
  program immediately. In Evolu apps, errors are handled by platform-specific
  `createRun` adapters at the app boundary.
- Module-level constants
- Test setup with values that are expected to be valid

Prefer an explicit `if (!result.ok)` check in ordinary application logic
where the caller can recover, retry, or choose a different flow.

### Example

```ts
// At app startup, crash if config is invalid:
const config = getOrThrow(loadConfig());
// Safe to use config here
```

Throws: `Error` with the original error attached as `cause`.