---
title: "validationDetail"
description: "Wrap a string into a TypeBox error callback that overrides the default validation message. Use as t.Number({ error: validationDetail('x must be a number') })."
url: "https://next.elysiajs.com/reference/variables/validationdetail/"
---

# validationDetail

```ts
const validationDetail: <T>(message) => (error) => any;
```

Defined in: elysia/dist/error.d.ts:39

Wrap a string into a TypeBox `error` callback that overrides the default validation message. Use as `t.Number({ error: validationDetail('x must be a number') })`.

## Type Parameters

| Type Parameter |
| -------------- |
| `T`            |

## Parameters

| Parameter | Type |
| --------- | ---- |
| `message` | `T`  |

## Returns

(`error`) => `any`
