packages/exception/docs/api/experimental/functions/tryOrFail.md
[**@httpx/exception**](../../README.md) • **Docs**
---
[@httpx/exception](../../README.md) / [experimental](../README.md) / tryOrFail
# Function: tryOrFail()
> **tryOrFail**\<`T`\>(`fn`): `Promise`\<`ReturnType`\<`T`\>\>
## Type Parameters
• **T** _extends_ `AsyncFn`\<`unknown`[], `unknown`\>
## Parameters
• **fn**: `T`
## Returns
`Promise`\<`ReturnType`\<`T`\>\>