Friday 15 December 2017

Is it bad form to use Promise catch() for operational conditions?

I inherited some code that uses Promise reject()/.catch() blocks for records not found in a database. These conditions are not "errors" per se, but are fully expected within the operation of the app.Is this correct form?I've always thought that a promise catch should be for unexpected errors and that a record not found condition should be dealt with in the resolve()/.then() blocks.Thanks!

Submitted December 16, 2017 at 04:30AM by 64bitHustler

No comments:

Post a Comment