Skip to content Skip to sidebar Skip to footer

Unhandled Rejection Error With Ajax Bluebird Promise Wrapper

I am trying to wrap Ajax into a Bluebird promise wrapper, but am receiving: Error: Unhandled rejection (stack trace here...) wrapper1.js let fetch = require('./wrapper2'); funct

Solution 1:

I figured it out, BlueBird wants to warn you that a reject() call has been fired but you are not catching it. So I was using...

requestWeb(type, url, data).then((result)=>{});

So to fix, do one of two things: add the .catch() to the end of the call, or remove the reject(err) from the promise.


Post a Comment for "Unhandled Rejection Error With Ajax Bluebird Promise Wrapper"