bytespider / jsOAuth

JavaScript implimentation of the OAuth protocol. Currently supports version 1.0 (RFC5849) of the specification. Node.js & CommonJS compatible.
http://bytespider.github.com/jsOAuth/
MIT License
557 stars 109 forks source link

Missing onerror callback for Titanium HTTPClient #44

Open samih-harfouche opened 11 years ago

samih-harfouche commented 11 years ago

when using jsOAuth-1.3.6.js with Titanium the "xhr" that is declared via Request(); xhr = Request(); should declare xhr.onerror function because titanium HTTPClient doesn't send readystate = 4 in case an error (like 401 error) accrued. therefore, the failure callback method never fires on HTTPClient error

xhr.onerror = function(e) { var responseObject = { error : e.error, source : xhr, status : this.status, statusText : this.statusText } failure(responseObject); };