> For the complete documentation index, see [llms.txt](https://musicq.gitbook.io/unwrapit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://musicq.gitbook.io/unwrapit/apis/expect.md).

# expect

Provide a customized error message when an error occurs.

```ts
const wrapper = await wrap<string, number>(Promise.reject('error'))
wrapper.expect('error message') // panic!
// error message
// [Cause] error
```
