# setCustomIdErrors

`function` in `custom-id` · v0.3.2

<https://seedcord.org/docs/packages/custom-id/0.3.2/functions/set-custom-id-errors>

Replace the errors that [`decode`](/docs/packages/custom-id/0.3.2/classes/custom-id#decode) throws. Call it before your bot receives any
interaction because the setting is process-wide and each call replaces the last one.

`stale` gets the route prefix and `invalid` gets a detail string. You can't localize the message per user
because neither one gets the interaction.

A [seedcord](https://seedcord.org) bot already calls this at import and replaces both defaults with
`Notice` subclasses that render a card. To change what the user reads, call it again with your own and
return a `Notice` subclass from each callback. A plain `Error` reaches the user as the generic fault card.

```ts
setCustomIdErrors(errors: CustomIdErrors): void
```

Replace the errors that [`decode`](/docs/packages/custom-id/0.3.2/classes/custom-id#decode) throws. Call it before your bot receives any
interaction because the setting is process-wide and each call replaces the last one.

`stale` gets the route prefix and `invalid` gets a detail string. You can't localize the message per user
because neither one gets the interaction.

A [seedcord](https://seedcord.org) bot already calls this at import and replaces both defaults with
`Notice` subclasses that render a card. To change what the user reads, call it again with your own and
return a `Notice` subclass from each callback. A plain `Error` reaches the user as the generic fault card.

Parameters.

- `errors` `CustomIdErrors`

Returns `void`.
