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

find() not calling error function when using find(id) syntax #735

Closed
namlet opened this issue Jun 28, 2013 · 1 comment
Closed

find() not calling error function when using find(id) syntax #735

namlet opened this issue Jun 28, 2013 · 1 comment

Comments

@namlet
Copy link

namlet commented Jun 28, 2013

var myid = 'bad';

Model.find(myid).error(function(err){
  console.log("never gets called");
});

The above throws a 500 error, kills the server and never calls the error handler.

Model.find({where: {id: myid}}).error(function(err){
  console.log("gets called");
});

This however calls the error handler and proceeds properly.

@ShimShamSam
Copy link

+1 on this issue. I'm having to check for null within the success and throw my own error. It's a bit of a pain.

@durango durango closed this as completed in 6ec6f6e Jul 4, 2013
janmeier added a commit that referenced this issue Jul 4, 2013
Strings for .find() should be fixed. Also added support for string primary keys to be found easily. Closes #735
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants