srhyne / jQuery-Parse

An AJAX wrapper for the Parse.com REST API
212 stars 31 forks source link

Not Found: Uncaught Errors #6

Open thauburger opened 12 years ago

thauburger commented 12 years ago

Hi,

I'm getting uncaught errors when I encounter a failed interaction with Parse (e.g. attempt to login with the wrong user / password combo).

Uncaught Error: $.parse :error Not Found
e.extend.errorjquery.min.js:2
_errorjquery.parse.js:38
f.Callbacks.njquery.min.js:2
f.Callbacks.o.fireWithjquery.min.js:2
wjquery.min.js:4
f.support.ajax.f.ajaxTransport.send.d

Any idea where this is coming from?

Thanks!

thauburger commented 12 years ago

Honestly, this could be an issue with my unfamiliarity with error handling conventions in jQuery. I've been working with node some lately, and the convention there is to pass the error back as the first parameter of the provided callback, e.g.:

function(error, result) {...};

But if there's a better / more standard way for me to be handling these sorts of errors, I'd appreciate the insight!

Thanks for writing this cool library.

Tom

srhyne commented 12 years ago

Hi Tom,

Seattle! Cool, I'm out in the sticks, Enumclaw. Anyways, I think I totally missed the boat on allowing you to pass your own error callback and just hard coded the default. I can change jquery.parse but ideally you pass your own like you are talking about. Will update soon, at least maybe I'll take out the $.error so it's not throwing a real js exception.

srhyne commented 12 years ago

Hi Tom,

I just added an optional error callback to every method except init. The error callback is attached to $.ajax's .fail deferred object. However, I think the error that you might be seeing too is caused by an issue with Chrome on how it's process some of the CORS stuff. See CHROME is making two full requests I think to process the CORS. So $.ajax is calling .fail on the first request then the real error callback on the latter. I need to figure out how to filter out the redirect request basically. (Is this making any sense? ;)

Check out the differences in errors when making a bad delete request..

I found this regarding the "OPTIONS" type being passed in Chrome

More on CORS docs

thauburger commented 12 years ago

Awesome. Thanks for the quick response. Yeah, I was seeing the Access-Control-Allow-Origin error in several places as well, when attempting to make cross-domain requests.