Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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

wants to merge 1 commit into from

Conversation

vkarpov15
Copy link
Contributor

No description provided.

@miguelcobain
Copy link

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

Please merge this ASAP. 😢

@vkarpov15
Copy link
Contributor Author

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 :)

@cades
Copy link

cades commented Mar 18, 2015

please merge +1
this helps monk, too

@vkarpov15
Copy link
Contributor Author

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

@oppenlander
Copy link

👍

1 similar comment
@tamtakoe
Copy link

+1

@Jokero
Copy link

Jokero commented Apr 27, 2015

@aheckmann merge PR, please

@nkt
Copy link

nkt commented May 5, 2015

@aheckmann Are u going to merge this?

@hustKiwi
Copy link

hustKiwi commented Jun 3, 2015

@vkarpov15 I recommend yaku as a replacement.

@vkarpov15
Copy link
Contributor Author

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

@refack
Copy link
Collaborator

refack commented Aug 15, 2015

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

@vkarpov15
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants