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

```ts
function createTypeErrorFormatter<Error>(
  format: (
    error: Simplify<
      Omit<Error, "value"> & {
        value: string;
      }
    >,
  ) => string,
): TypeErrorFormatter<Error>;
```

Defined in: [packages/common/src/Type.ts:671](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Type.ts#L671)

Creates a formatter function for [TypeError](https://evolu.dev/docs/api-reference/common/Type/interfaces/TypeError).

The formatter generates human-readable error messages using a custom
formatting function and a safely stringified error value.

### Example

```ts
const formatStringError = createTypeErrorFormatter<StringError>(
  (value) => `A value ${value} is not a string.`,
);
```