Skip to content Skip to sidebar Skip to footer
Showing posts with the label Bluebird

Swap Order Of Arguments To "then" With Bluebird / Nodejs Promises

I have a function which asynchronously grabs a value from a server: var request = require('requ… Read more Swap Order Of Arguments To "then" With Bluebird / Nodejs Promises

Catch Error Type In Bluebird Not Working

I have a custom error class: class NetworkError extends Error { constructor() { super('Ne… Read more Catch Error Type In Bluebird Not Working

Catching Errors Generated In Promises Within Promises In Javascript

Is it possible to have errors bubble up in Promises? See the code below for reference, I'd like… Read more Catching Errors Generated In Promises Within Promises In Javascript

Can't Apply Lodash Partial To Function Created With Bluebird Promisifyall

The below code takes a all the methods in object lib and promisify's them. Then I can use the c… Read more Can't Apply Lodash Partial To Function Created With Bluebird Promisifyall

How To Call Promise Function In Loop And Save Its Return Value

I have created a promise function(using bluebird) called getBasketObject. This function expects a b… Read more How To Call Promise Function In Loop And Save Its Return Value

Best Way To Handle Early Returns In Chains Of Promises?

What's the best way to handle early returns in Bluebird without throwing an error. For example,… Read more Best Way To Handle Early Returns In Chains Of Promises?

Proper While() Loop For Bluebird Promises (without Recursion?)

I've been learning promises using bluebird for two weeks now. I have them mostly understood, b… Read more Proper While() Loop For Bluebird Promises (without Recursion?)

I Broke My Promise

So.. I'm having the hardest time learning how to Promise. I'm using bluebird (https://githu… Read more I Broke My Promise

Request-promise Unhandled Rejection Requesterror: Error: Etimedout

Hi i try to write some download function by promise request, but if i have a timeout i cant handled… Read more Request-promise Unhandled Rejection Requesterror: Error: Etimedout

Wait For Promises From A For Loop

The following code does not really do what I want. function doIt () { return new Promise (functio… Read more Wait For Promises From A For Loop

Poll For A Result N Times (with Delays Between Attempts) Before Failing

We need to write a Node.js function that polls a certain API endpoint for a result of a previously … Read more Poll For A Result N Times (with Delays Between Attempts) Before Failing

How Do I Know Which Handlers Throw Error In Promise?

Suppose I have a promise as following: p.then(Task1) .then(Task2) .then(Task3) .catch(errorHandl… Read more How Do I Know Which Handlers Throw Error In Promise?

How To Turn Nested Callback Into Promise?

Recently I started using pg-promise with bluebird library. I have always been nesting callback and … Read more How To Turn Nested Callback Into Promise?

Can I Break A Chain Early With Bluebird Promises?

I don't necessarily want to error, but I have: getFromDb().then (tradeData) -> if not trad… Read more Can I Break A Chain Early With Bluebird Promises?