> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tappify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SERVER_ERROR_CODES

> The codes createTappifyHandler answers with itself, keyed by a short name.

```ts theme={null}
const SERVER_ERROR_CODES: {
  BODY_INVALID: "TAP_BODY_INVALID";
  BODY_TOO_LARGE: "TAP_BODY_TOO_LARGE";
  EVENT_ID_MISSING: "TAP_EVENT_ID_MISSING";
  HANDLER_MISSING: "TAP_HANDLER_MISSING";
  INTERNAL_ERROR: "TAP_INTERNAL_ERROR";
  ROUTE_UNKNOWN: "TAP_ROUTE_UNKNOWN";
  TOKEN_AUDIENCE: "TAP_TOKEN_AUDIENCE";
  TOKEN_INVALID: "TAP_TOKEN_INVALID";
  TOKEN_MISSING: "TAP_TOKEN_MISSING";
  WEBHOOK_REJECTED: "TAP_WEBHOOK_REJECTED";
};
```

The codes `createTappifyHandler` answers with itself, keyed by a short name.

## Type Declaration

### BODY\_INVALID

```ts theme={null}
readonly BODY_INVALID: "TAP_BODY_INVALID" = 'TAP_BODY_INVALID';
```

### BODY\_TOO\_LARGE

```ts theme={null}
readonly BODY_TOO_LARGE: "TAP_BODY_TOO_LARGE" = 'TAP_BODY_TOO_LARGE';
```

### EVENT\_ID\_MISSING

```ts theme={null}
readonly EVENT_ID_MISSING: "TAP_EVENT_ID_MISSING" = 'TAP_EVENT_ID_MISSING';
```

### HANDLER\_MISSING

```ts theme={null}
readonly HANDLER_MISSING: "TAP_HANDLER_MISSING" = 'TAP_HANDLER_MISSING';
```

### INTERNAL\_ERROR

```ts theme={null}
readonly INTERNAL_ERROR: "TAP_INTERNAL_ERROR" = 'TAP_INTERNAL_ERROR';
```

### ROUTE\_UNKNOWN

```ts theme={null}
readonly ROUTE_UNKNOWN: "TAP_ROUTE_UNKNOWN" = 'TAP_ROUTE_UNKNOWN';
```

### TOKEN\_AUDIENCE

```ts theme={null}
readonly TOKEN_AUDIENCE: "TAP_TOKEN_AUDIENCE" = 'TAP_TOKEN_AUDIENCE';
```

### TOKEN\_INVALID

```ts theme={null}
readonly TOKEN_INVALID: "TAP_TOKEN_INVALID" = 'TAP_TOKEN_INVALID';
```

### TOKEN\_MISSING

```ts theme={null}
readonly TOKEN_MISSING: "TAP_TOKEN_MISSING" = 'TAP_TOKEN_MISSING';
```

### WEBHOOK\_REJECTED

```ts theme={null}
readonly WEBHOOK_REJECTED: "TAP_WEBHOOK_REJECTED" = 'TAP_WEBHOOK_REJECTED';
```

## Remarks

Every one of these comes from the SDK, not from your own handlers: a route or
handler that is not there, a token that is missing or does not verify, a missing
event id, a body that is not JSON or is over 1 MB, a webhook Tappify rejected,
and the catch-all for an error a handler let escape. Throw a `TapServerError`
with a code of your own for anything your server decides.
