Promise support
Richienb opened this issue · comments
Richie Bendall commented
It would be useful if nice-try supported promises:
const niceTry = require('nice-try')
const result = await niceTry.promise(async () => {...})
Implementation:
module.exports.promise = async function(fn) {
try { return await fn() } catch (e) {}
}
// @electerious
Angshu31 commented
Maybe this should be PR instead of an issue; you already have the implementation.
Tobias Reich commented
Just published v2.1 🚀