Permalink
Browse files

Better error messages

  • Loading branch information...
1 parent c38dc1e commit e5f8bc709dcdee3968f87002a5987d6d24ed7ed9 @theopolisme theopolisme committed Oct 13, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core.js
View
6 src/core.js
@@ -180,7 +180,7 @@ function afcHelper_deletePage(title,reason) {
$('#afcHelper_delete' + jqEsc(title)).html('Deleted <a href="' + wgArticlePath.replace("$1", encodeURI(title)) + '" title="' + title + '">' + title + '</a>');
return true;
} else {
- $('#afcHelper_delete' + jqEsc(title)).html('<div style="color:red"><b>Deletion failed on <a href="' + wgArticlePath.replace("$1", encodeURI(title)) + '" title="' + title + '">' + title + '</a></b></div>. Error info:' + error);
+ $('#afcHelper_delete' + jqEsc(title)).html('<div style="color:red"><b>Deletion failed on <a href="' + wgArticlePath.replace("$1", encodeURI(title)) + '" title="' + title + '">' + title + '</a></b></div>. Error info: ' + JSON.stringify(delresponse));
return false;
}
}
@@ -207,7 +207,7 @@ function afcHelper_editPage(title, newtext, summary, createonly, nopatrol) {
if ( data && data.edit && data.edit.result && data.edit.result == 'Success' ) {
$('#afcHelper_edit' + jqEsc(title)).html('Saved <a href="' + wgArticlePath.replace("$1", encodeURI(title)) + '" title="' + title + '">' + title + '</a>');
} else {
- $('#afcHelper_edit' + jqEsc(title)).html('<span class="afcHelper_notice"><b>Edit failed on <a href="' + wgArticlePath.replace("$1", encodeURI(title)) + '" title="' + title + '">' + title + '</a></b></span>. Error info:' + data['error']['code'] + ': ' + data['error']['info']);
+ $('#afcHelper_edit' + jqEsc(title)).html('<span class="afcHelper_notice"><b>Edit failed on <a href="' + wgArticlePath.replace("$1", encodeURI(title)) + '" title="' + title + '">' + title + '</a></b></span>. Error info: ' + JSON.stringify(data));
}
} )
.fail( function ( error ) {
@@ -240,7 +240,7 @@ function afcHelper_editPage(title, newtext, summary, createonly, nopatrol) {
if ( data ) {
$('#afcHelper_patrol' + jqEsc(title)).html('Marked <a href="' + wgArticlePath.replace("$1", encodeURI(title)) + '" title="' + title + '">' + title + '</a> as patrolled');
} else {
- $('#afcHelper_patrol' + jqEsc(title)).html('<span class="afcHelper_notice"><b>Patrolling failed on <a href="' + wgArticlePath.replace("$1", encodeURI(title)) + '" title="' + title + '">' + title + '</a></b></span>. Error info:' + data['error']['code'] + ': ' + data['error']['info']);
+ $('#afcHelper_patrol' + jqEsc(title)).html('<span class="afcHelper_notice"><b>Patrolling failed on <a href="' + wgArticlePath.replace("$1", encodeURI(title)) + '" title="' + title + '">' + title + '</a></b></span> with an unknown error');
}
} )
.fail( function ( error ) {

2 comments on commit e5f8bc7

@Technical-13
WikiProject Articles for creation member

Good start, but it needs to be added to console.error(); too because I've seen times when the error only flashes for a second and then gets over written by "saved" or something else... I'll add that now and see if I can get another one of those...

@theopolisme

See comments in #177; I disagree with the console use.

Please sign in to comment.