Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise support #25

Closed
Richienb opened this issue Aug 15, 2020 · 2 comments · Fixed by #26
Closed

Promise support #25

Richienb opened this issue Aug 15, 2020 · 2 comments · Fixed by #26

Comments

@Richienb
Copy link
Contributor

Richienb commented Aug 15, 2020

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
Copy link

Angshu31 commented Oct 9, 2020

Maybe this should be PR instead of an issue; you already have the implementation.

@electerious
Copy link
Owner

Just published v2.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants