Skip to content

Commit

Permalink
Message to user on error about the path to the WT log file.
Browse files Browse the repository at this point in the history
  • Loading branch information
creoludifico committed Jan 21, 2017
1 parent bd8e693 commit 9aa430d
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 31 deletions.
19 changes: 12 additions & 7 deletions http/jscript/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ webtools.list_modules.inline([
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the version from the server. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed fetching the version from the server.', data);
webtools.list_modules.abort('Error: ' + data.statusText);
}
});
Expand Down Expand Up @@ -146,7 +146,7 @@ webtools.list_modules.inline([
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the languagecodes from the server. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed fetching the languagecodes from the server.', data);
webtools.list_modules.abort('Error: ' + data.statusText);
}
});
Expand Down Expand Up @@ -277,16 +277,21 @@ webtools.activate_module = function(modulename) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed activating the module. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed activating the module.', data);
}
});
};

// The only purpose of this is to display a modal with an error message.
webtools.display_error = function(message, ajaxobject) {
$('#myModalLabel').html('An error occured.');

if (typeof(ajaxobject) != 'undefined') {
$('#myModalLabel').html('An error occured.');

message += '<br /><br /> Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex thread <a href="https://forums.plex.tv/discussion/126254" target="_blank">here</a> if it occurs again. ';
message += '<br /> You can find the log file for WebTools here: *\Plex Media Server\Logs\PMS Plugin Logs\com.plexapp.plugins.WebTools.log';

if (typeof (ajaxobject) != 'undefined') {
message += '<br /><br />';
message += 'Technical details: <br />';
message += '<hr>Errorinfo:' + '<br>Requested URL: ' + ajaxobject.url + '<br>Error Code/Message: ' + ajaxobject.status + '/' + ajaxobject.statusText;
}

Expand Down Expand Up @@ -337,7 +342,7 @@ webtools.listlogfiles = function(callback, activatemodulename) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the logfilenames from the server. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed fetching the logfilenames from the server.', data);

if (typeof(callback) != 'undefined') {
webtools.list_modules.abort('Error: ' + data.statusText);
Expand Down
10 changes: 5 additions & 5 deletions http/modules/findmedia/jscript/findmedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ findmedia.loading.inline([
console.log('error:' + data);
data.url = this.url;
findmedia.loading.abort();
webtools.display_error('Failed fetching the settings from the server. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed fetching the settings from the server.', data);
}
});
},
Expand All @@ -56,7 +56,7 @@ findmedia.loading.inline([
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the sections from the server. Please restart the server.', data);
webtools.display_error('Failed fetching the sections from the server. ', data);
findmedia.loading.abort('Error: ' + data.statusText);
}

Expand Down Expand Up @@ -218,7 +218,7 @@ findmedia.scanning_start = function(sectionKey) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed starting the scanning. Please restart the server.', data);
webtools.display_error('Failed starting the scanning. ', data);
findmedia.loading.abort('Error: ' + data.statusText);
}

Expand All @@ -243,7 +243,7 @@ findmedia.scanning_wait = function() {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the status from the server. Please restart the server.', data);
webtools.display_error('Failed fetching the status from the server.', data);
findmedia.loading.abort('Error: ' + data.statusText);
}

Expand Down Expand Up @@ -304,7 +304,7 @@ findmedia.scanning_present_result = function() {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the results from the server. Please restart the server.', data);
webtools.display_error('Failed fetching the results from the server.', data);
findmedia.loading.abort('Error: ' + data.statusText);
}

Expand Down
16 changes: 8 additions & 8 deletions http/modules/install/jscript/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ install.loadChannels = function (InitalRun) {
if (data.responseText.indexOf('Errno 13') != -1) {
webtools.display_error('Failed updating UAS Cache. Looks like permissions are not correct, because we where denied access to create a needed directory.<br>If running on Linux, you might have to issue: <b>sudo chown plex:plex ./WebTools.bundle -R</b>' , data);
} else {
webtools.display_error('Failed updating UAS Cache. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.<br>' , data);
webtools.display_error('Failed updating UAS Cache.' , data);
}
loader.abort();
}
Expand Down Expand Up @@ -314,7 +314,7 @@ install.loadChannels = function (InitalRun) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the list of channels from the server. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed fetching the list of channels from the server. ', data);
loader.abort();
}
})
Expand All @@ -337,7 +337,7 @@ install.loadChannels = function (InitalRun) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the list of categories from the server. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed fetching the list of categories from the server. ', data);
loader.abort();
}
})
Expand Down Expand Up @@ -618,7 +618,7 @@ install.checkForUpdates = function(spanname, github) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed checking for updates for the plugin. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed checking for updates for the plugin. ', data);
}
})

Expand Down Expand Up @@ -651,7 +651,7 @@ install.removebundlework = function(key) {
$('#myModalFoot').html('<button type="button" class="btn btn-default" onClick="install.loadChannels();" data-dismiss="modal">Close</button>');
} else {
data.url = this.url;
webtools.display_error('Failed uninstalling the bundle. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed uninstalling the bundle. ', data);
}
}
})
Expand Down Expand Up @@ -687,7 +687,7 @@ install.initiatemigrate = function() {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed migrating previously installed channels.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed migrating previously installed channels.', data);
}
})
}
Expand Down Expand Up @@ -723,7 +723,7 @@ install.massiveupdatechecker = function() {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed migrating previously installed channels.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed migrating previously installed channels.', data);
}
})
}
Expand Down Expand Up @@ -942,7 +942,7 @@ install.forceRepoUpdate = function() {
if (data.responseText.indexOf('Errno 13') != -1) {
webtools.display_error('Failed updating UAS Cache. Looks like permissions are not correct, because we where denied access to create a needed directory.<br>If running on Linux, you might have to issue: <b>sudo chown plex:plex ./WebTools.bundle -R</b>' , data);
} else {
webtools.display_error('Failed updating UAS Cache. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.<br>' , data);
webtools.display_error('Failed updating UAS Cache.' , data);
}
}
})
Expand Down
4 changes: 2 additions & 2 deletions http/modules/logviewer/jscript/logviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ logviewer.fetchlogfiles = function() {
},
error: function(data, statustext, errorthrown) {
data.url = this.url;
webtools.display_error('Failed fetching the settings from the server. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed fetching the settings from the server.', data);
}
});
};
Expand Down Expand Up @@ -96,7 +96,7 @@ logviewer.viewlogfile = function(filename) {
error: function(data) {
data.url = this.url;
webtools.log('Failed fetching ' + filename);
webtools.display_error('Failed fetching the logfile from the server. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed fetching the logfile from the server.', data);
}
});
}
Expand Down
8 changes: 4 additions & 4 deletions http/modules/subtitlemgmt/jscript/functions_shows.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ subtitlemgmt.fetch_section_type_show = function(section_key, pageToShow) {
error: function(data) {
data.url = this.url;
webtools.log('Error: Failed fetching the size of the section. The section was: ' + subtitlemgmt.selected_section.title)
webtools.display_error('Failed fetching the size of the section from the server. Please restart the server.', data);
webtools.display_error('Failed fetching the size of the section from the server. ', data);
get_show.abort('Error: ' + data.statusText);
}
});
Expand All @@ -61,7 +61,7 @@ subtitlemgmt.fetch_section_type_show = function(section_key, pageToShow) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the section contents from the server. Please restart the server.', data);
webtools.display_error('Failed fetching the section contents from the server.', data);
get_show.abort('Error: ' + data.statusText);
}
});
Expand Down Expand Up @@ -135,7 +135,7 @@ subtitlemgmt.fetch_show_seasons = function(show_key, pageToShow) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the seasons from the server. Please restart the server.', data);
webtools.display_error('Failed fetching the seasons from the server.', data);
get_season.abort('Error: ' + data.statusText);
}
});
Expand Down Expand Up @@ -193,7 +193,7 @@ subtitlemgmt.fetch_season_episodes = function(season_key, pageToShow) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the episodes from the server. Please restart the server.', data);
webtools.display_error('Failed fetching the episodes from the server.', data);
get_episodes.abort('Error: ' + data.statusText);
}
});
Expand Down
6 changes: 3 additions & 3 deletions http/modules/subtitlemgmt/jscript/functions_video.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ subtitlemgmt.fetch_section_type_movies = function(section_key, pageToShow) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the size of the section from the server. Please restart the server.', data);
webtools.display_error('Failed fetching the size of the section from the server.', data);
get_section_video.abort('Error: ' + data.statusText);
}
});
Expand Down Expand Up @@ -119,7 +119,7 @@ subtitlemgmt.fetch_section_type_movies = function(section_key, pageToShow) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the section contents from the server. Please restart the server.', data);
webtools.display_error('Failed fetching the section contents from the server.', data);
get_section_video.abort('Error: ' + data.statusText);
}
});
Expand Down Expand Up @@ -415,7 +415,7 @@ subtitlemgmt.view_subtitle = function(mediaKey, subtitleKey) {
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the section contents from the server. Please restart the server.', data);
webtools.display_error('Failed fetching the section contents from the server.', data);
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions http/modules/subtitlemgmt/jscript/subtitlemgmt.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ subtitlemgmt.get_section_list.inline([
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the settings from the server. Reload the page and try again.<br>If the error persists please restart the server.<br>Contact devs on the Plex forums if it occurs again.', data);
webtools.display_error('Failed fetching the settings from the server.', data);
subtitlemgmt.get_section_list.abort('Error: ' + data.statusText);
}
});
Expand Down Expand Up @@ -189,7 +189,7 @@ subtitlemgmt.get_section_list.inline([
},
error: function(data) {
data.url = this.url;
webtools.display_error('Failed fetching the sections from the server. Please restart the server.', data);
webtools.display_error('Failed fetching the sections from the server.', data);
subtitlemgmt.get_section_list.abort('Error: ' + data.statusText);
}

Expand Down

0 comments on commit 9aa430d

Please sign in to comment.