Dynamoose: In Model.put() / Model.save(), the returned promise is not rejected on error

Created on 24 Aug 2017  路  6Comments  路  Source: dynamoose/dynamoose

For example, if doing a conditional save that fails, the returned promise object is resolved instead of being rejected.
This happens because the following code returns the wrong promise:
if(model$.options.waitForActive) { return model$.table.waitForActive().then(putItem).catch(deferred.reject); }

Suggested fix:
return deferred.promise.nodeify(next) instead.

Most helpful comment

Ugh, just spent the last hour trying to recreate the issue with a failing test before I spotted that this has already been fixed at #200 :-(

Any chance of publishing a new version?

All 6 comments

Would you be willing to correct it in a PR?

I've just hit this same issue with Model.create. I'll put together a PR.

Ugh, just spent the last hour trying to recreate the issue with a failing test before I spotted that this has already been fixed at #200 :-(

Any chance of publishing a new version?

A new version for this bug would be of great help for me as well!

@lennym Sorry for not publishing an updated release and sorry for not getting back any sooner. I've been slammed lately and some of my sided projects (i.e. this one have suffered). I'll try to push out an updated version this week.

The fix is in 0.8.6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mogwai picture mogwai  路  5Comments

craigsketchley picture craigsketchley  路  5Comments

fishcharlie picture fishcharlie  路  7Comments

arthurvi picture arthurvi  路  7Comments

markronquillo picture markronquillo  路  3Comments