[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) › Err

Defined in: [packages/common/src/Result.ts:299](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Result.ts#L299)

An error [Result](https://evolu.dev/docs/api-reference/common/Result/type-aliases/Result).

The `error` property can be any type that describes the error. For domain
errors, define a plain interface extending [Typed](https://evolu.dev/docs/api-reference/common/Type/interfaces/Typed).

### Example

```ts
import {
  assertErr,
  assertOk,
  err,
  ok,
  type Result,
  type Typed,
} from "@evolu/common";

interface User {
  readonly id: string;
}

const users = new Map<string, User>([["user-1", { id: "user-1" }]]);
const findUser = (id: string): Result<User, NotFoundError> => {
  const user = users.get(id);
  if (user == null) return err({ type: "NotFound", id });
  return ok(user);
};

interface NotFoundError extends Typed<"NotFound"> {
  readonly id: string;
}

assertOk(findUser("user-1"), { id: "user-1" });
assertErr(findUser("missing"), {
  type: "NotFound",
  id: "missing",
});
```

## Properties

<a id="error"></a>

### error

```ts
readonly error: E;
```

Defined in: [packages/common/src/Result.ts:301](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Result.ts#L301)

---

<a id="ok"></a>

### ok

```ts
readonly ok: false;
```

Defined in: [packages/common/src/Result.ts:300](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Result.ts#L300)