i can do you one better ;)

https://github.com/segmentio/on-error/blob/master/index.js

```js
var onError = require('on-error');
```