Closed narqo closed 8 years ago
wow
We've discussed this with @ruslankerimov and desided that ensureError
is still useful in scenarios like failed promises resolution.
new Promise((resolve, reject) => {
try {
data = JSON.parse(sdata);
} catch(err) {
return reject(err);
}
data.condition ? resolve(data) : reject(AppError.createError(...));
})
.catch(err => throw AppError.ensureError(err, AppError.CODES.UNKNOWN_ERROR));
But this PR has some additional fixes, I'll cherry-pick them to the separate PRs later.
closes #28
/cc @kaero