mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 00:06:07 -07:00
Catch json parse error for current activity
This commit is contained in:
parent
38116a14f3
commit
0d38b3de16
1 changed files with 11 additions and 1 deletions
|
@ -103,10 +103,20 @@
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
cache: false,
|
cache: false,
|
||||||
async: true,
|
async: true,
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.log(status + ': ' + error);
|
||||||
|
},
|
||||||
complete: function (xhr, status) {
|
complete: function (xhr, status) {
|
||||||
$('#dashboard-checking-activity').remove();
|
$('#dashboard-checking-activity').remove();
|
||||||
|
|
||||||
var current_activity = $.parseJSON(xhr.responseText);
|
var current_activity;
|
||||||
|
try {
|
||||||
|
current_activity = $.parseJSON(xhr.responseText);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(status + ': ' + e);
|
||||||
|
current_activity = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(current_activity)) {
|
if (!(current_activity)) {
|
||||||
$('#currentActivity').html('<div id="dashboard-no-activity" class="text-muted">There was an error communicating with your Plex Server.</div>');
|
$('#currentActivity').html('<div id="dashboard-no-activity" class="text-muted">There was an error communicating with your Plex Server.</div>');
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue