jQuery throws error when responding to findOne/findAll with an error code #61

merged 1 commit into from Jun 29, 2012


None yet
1 participant

ghost commented Jun 29, 2012

jQuery throws an error when responding to findOne (findAll) with an error code like 404.

second argument to Function.prototype.apply must be an array 

Tracked it down to the function pipe in model/model.js where .apply is used on rejectWith to set context.


arguments is something like

[jqXHR, "error", "Not Found"]

But rejectWith takes its first argument as the new context which is the jqXHR object in this case and then takes "error" as its args

Changed the function to use rejectWith and resolveWith without .apply

ralphholzmann merged commit 5d9e56a into canjs:master Jun 29, 2012


ralphholzmann commented Jun 29, 2012

Great fix. Thank you!

@WearyMonkey WearyMonkey pushed a commit to WearyMonkey/canjs that referenced this pull request Dec 31, 2012

@justinbmeyer justinbmeyer fixes #61 2b3cce2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment