From a993b440dc79a5a588614ed4401940b2cf547072 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 19 Jan 2014 15:18:57 -0700 Subject: [PATCH] Try to get some better errors out of QR.req.onerror Conflicts: builds/4chan-X.user.js builds/crx/script.js src/General/css/layout.css --- LICENSE | 2 +- builds/4chan-X.user.js | 7 +++++-- builds/crx/script.js | 7 +++++-- src/Posting/QR.coffee | 8 +++++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/LICENSE b/LICENSE index 6c15e974c..63b08e1b2 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.3.2 - 2014-01-18 +* 4chan X - Version 1.3.2 - 2014-01-19 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 75dbae7a6..a09638157 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -22,7 +22,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.3.2 - 2014-01-18 +* 4chan X - Version 1.3.2 - 2014-01-19 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -6212,11 +6212,14 @@ responseType: 'document', withCredentials: true, onload: QR.response, - onerror: function() { + onerror: function(err, url, line) { delete QR.req; post.unlock(); QR.cooldown.auto = false; QR.status(); + console.log(err); + console.log(url); + console.log(line); return QR.error($.el('span', { innerHTML: "4chan X encountered an error while posting. \n[Banned?] [More info]" })); diff --git a/builds/crx/script.js b/builds/crx/script.js index b2050c249..ef1e9fdee 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.3.2 - 2014-01-18 +* 4chan X - Version 1.3.2 - 2014-01-19 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -6203,11 +6203,14 @@ responseType: 'document', withCredentials: true, onload: QR.response, - onerror: function() { + onerror: function(err, url, line) { delete QR.req; post.unlock(); QR.cooldown.auto = false; QR.status(); + console.log(err); + console.log(url); + console.log(line); return QR.error($.el('span', { innerHTML: "4chan X encountered an error while posting. \n[Banned?] [More info]" })); diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index bc5831b73..64a99ceff 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -590,13 +590,15 @@ QR = responseType: 'document' withCredentials: true onload: QR.response - onerror: -> - # Connection error, or - # www.4chan.org/banned + onerror: (err, url, line) -> + # Connection error, or www.4chan.org/banned delete QR.req post.unlock() QR.cooldown.auto = false QR.status() + console.log err + console.log url + console.log line QR.error $.el 'span', innerHTML: """ 4chan X encountered an error while posting.