madrobby/zepto — pull request #695 by gilmoreorless (2013-02-15 06:17:01+00:00)
Title: Pass abort/timeout statuses and xhr.statusText to global ajaxError event handlers

I noticed that since commit b788839ab6cddc2924819b21e8ced8802bbf4b27 the "abort" status is passed to the inline `error` callback (which is good).
Unfortunately this wasn't also passed up to the global `ajaxError` event (nor were "timeout" statuses).

While fixing this for a project I also passed through the HTTP status text (if available) to the error handlers in the event of a 4xx or 5xx response. This more closely matches the jQuery ajax error handlers.

I've also added a couple of tests that were missing: JSON parse errors and XHR abort.

Cheers,
Gil

PS. As a side note, I've made a test page for comparing the callback signatures between Zepto and jQuery: http://zepto-gildev.herokuapp.com/test/compare_ajax.html
A red row just indicates a difference in signatures, not necessarily a problem (in some cases Zepto gives more information).

Would it be valuable to fix up some of the other differences? I think Zepto not firing error callbacks for a beforeSend cancellation is a bug