Add proper exception handling for comments, rather than sliently failing

This commit is contained in:
techmetx11 2023-04-26 21:41:28 +01:00 committed by Samantaz Fox
parent bbf16279bb
commit 1300a8393b
No known key found for this signature in database
GPG key ID: F42821059186176E
4 changed files with 59 additions and 4 deletions

View file

@ -219,9 +219,7 @@ function get_youtube_comments() {
'&hl=' + video_data.preferences.locale +
'&thin_mode=' + video_data.preferences.thin_mode;
var onNon200 = function (xhr) { comments.innerHTML = fallback; };
if (video_data.params.comments[1] === 'youtube')
onNon200 = function (xhr) {};
var onNon200 = function (xhr) { comments.innerHTML = xhr.response.errorHtml; };
helpers.xhr('GET', url, {retries: 5, entity_name: 'comments'}, {
on200: function (response) {