implement When to securely wrap a promise; wrap callback and errback so exceptions thrown get transformed into rejections