Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Bluebird = require('bluebird')
- async function asyncFunction() {
- return Bluebird.resolve(42)
- }
- function notAsyncFunction() {
- return Bluebird.resolve(42)
- }
- // will throw
- try {
- asyncFunction().tap()
- } catch(e) {
- console.log('Async version threw')
- }
- // will not throw
- try {
- notAsyncFunction().tap()
- console.log('NotAsync didnt throw')
- } catch(e) {
- console.log('This message will never be displayed')
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement