give better log when jqxhr is empty

pull/3065/head
Isaac Connor 2020-10-26 13:06:41 -04:00
parent 59cf5c33c2
commit 1f64a263eb
1 changed files with 5 additions and 0 deletions

View File

@ -351,6 +351,11 @@ if ( currentView != 'none' && currentView != 'login' ) {
.done(setNavBar)
.fail(function(jqxhr, textStatus, error) {
console.log("Request Failed: " + textStatus + ", " + error);
if ( ! jqxhr.responseText ) {
console.log("No responseText in jqxhr");
console.log(jqxhr);
return;
}
console.log("Response Text: " + jqxhr.responseText.replace(/(<([^>]+)>)/gi, ''));
if ( textStatus != "timeout" ) {
// The idea is that this should only fail due to auth, so reload the page