apr-intercept
Version:
Intercepts errors, the Go way!
25 lines (15 loc) • 819 B
Markdown
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
<a id="intercept"></a>
Intercepts errors, the Go way!
[](https://www.npmjs.com/package/apr-intercept) [](https://www.npmjs.com/package/apr-intercept)
**Parameters**
- `input` **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
**Examples**
```javascript
import ctch from 'apr-intercept';
const [err1, res1] = await ctch(fn(1));
const [err2, res2] = await ctch(fn(1));
const [, res3] = await ctch(fn(3));
```
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)**