mv try catch out of main function

Moved `try-catch` to another function to improve speed.
Callback called twice when error occur:
- with first argument `error`
- with first argument `undefined`

[Optimization killers](https://github.com/petkaantonov/bluebird/wiki/Optimization-killers)