mpromise icon indicating copy to clipboard operation
mpromise copied to clipboard

Fix LearnBoost/mongoose#2308: add .catch()

Open vkarpov15 opened this issue 10 years ago • 12 comments

vkarpov15 avatar Nov 26 '14 15:11 vkarpov15

Is there any way we can "monkey patch" this in our apps while this isn't merged and released?

Please merge this ASAP. :cry:

miguelcobain avatar Dec 24 '14 18:12 miguelcobain

You can do a really gnarly hack:

require('mongoose/node_modules/mpromise').prototype.catch = function (onReject) {
  return this.then(undefined, onReject);
};

But of course you'd have to maintain that code yourself. On the other hand, catch() is a trivial wrapper around then() anyway, so not a big deal :)

vkarpov15 avatar Dec 31 '14 15:12 vkarpov15

please merge +1 this helps monk, too

cades avatar Mar 18 '15 06:03 cades

Still waiting on this, but with LearnBoost/mongoose#2688 this will be a non-issue. I'm strongly considering deprecating mongoose's 'mpromise by default' practice.

vkarpov15 avatar Mar 18 '15 13:03 vkarpov15

:+1:

oppenlander avatar Apr 08 '15 21:04 oppenlander

+1

tamtakoe avatar Apr 27 '15 08:04 tamtakoe

@aheckmann merge PR, please

Jokero avatar Apr 27 '15 18:04 Jokero

@aheckmann Are u going to merge this?

nkt avatar May 05 '15 12:05 nkt

@vkarpov15 I recommend yaku as a replacement.

hustKiwi avatar Jun 03 '15 14:06 hustKiwi

See Automattic/mongoose#2688 - mongoose is gonna switch to a BYOP approach

vkarpov15 avatar Jun 03 '15 16:06 vkarpov15

@vkarpov15 I'd be happy to merge, but I need some more test cases.

refack avatar Aug 15 '15 22:08 refack

mongoose is gonna be moving away from mpromise, and the latest release supports "bring your own promises", so this is not a priority. If you won't merge this PR as is, feel free to close it.

vkarpov15 avatar Aug 16 '15 18:08 vkarpov15