class · Browser and Node

# BodyError

Why a body could not be read, in the TSP binding's failure terms.

`@toip-tools/trust-core` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/trust-core/src/compact.ts#L32)

Import:

```ts
import { BodyError } from "@toip-tools/trust-core";
```

## Constructor

Constructor:

```ts
new (failure: "invalidBody" | "wrongEnvelopeType", message: string): BodyError;
```

### Parameters

- **`failure` (required)**: `"invalidBody" | "wrongEnvelopeType"`
- **`message` (required)**: `string`

### Returns

`BodyError`

## Properties

- **`failure` (required · readonly)**: `"invalidBody" | "wrongEnvelopeType"`

[Usage guide](https://toip.tools/toolkit/trust-core/#usage) · [Error handling](https://toip.tools/toolkit/trust-core/#errors) · [All exports](https://toip.tools/toolkit/trust-core/api/)

---

This is the Markdown version of https://toip.tools/toolkit/trust-core/api/BodyError/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
