Properly handle errors opening tasks/shots.
This commit is contained in:
@@ -45,7 +45,14 @@ function item_open(item_id, item_type, pushState)
|
|||||||
console.log('Error fetching task', item_id, 'from', item_url);
|
console.log('Error fetching task', item_id, 'from', item_url);
|
||||||
console.log('XHR:', xhr);
|
console.log('XHR:', xhr);
|
||||||
}
|
}
|
||||||
$('#item-details').html(xhr.responseText);
|
$('#status-bar').text('Opening ' + item_type + ' failed.');
|
||||||
|
if (xhr.status) {
|
||||||
|
$('#item-details').html(xhr.responseText);
|
||||||
|
} else {
|
||||||
|
$('#item-details').html('<p class="text-danger">Opening ' + item_type + ' failed. There possibly was ' +
|
||||||
|
'an error connecting to the server. Please check your network connection and ' +
|
||||||
|
'try again.</p>');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Determine whether we should push the new state or not.
|
// Determine whether we should push the new state or not.
|
||||||
|
Reference in New Issue
Block a user