diff --git a/src/modules/chat/rich_providers.js b/src/modules/chat/rich_providers.js index 150b9fdf..72f2f00f 100644 --- a/src/modules/chat/rich_providers.js +++ b/src/modules/chat/rich_providers.js @@ -34,7 +34,23 @@ export const Links = { timeout: 0, getData: async () => { - const data = await this.get_link_info(token.url); + let data; + try { + data = await this.get_link_info(token.url); + } catch(err) { + return { + url: token.url, + title: this.i18n.t('card.error', 'An error occurred.'), + desc_1: err + } + } + + if ( ! data ) + return { + url: token.url, + title: this.i18n.t('card.error', 'An error occurred.'), + desc_1: this.i18n.t('card.empty', 'No data was returned.') + } return { url: token.url, diff --git a/src/sites/twitch-twilight/modules/chat/rich_content.jsx b/src/sites/twitch-twilight/modules/chat/rich_content.jsx index 3c49507d..c6f42f4e 100644 --- a/src/sites/twitch-twilight/modules/chat/rich_content.jsx +++ b/src/sites/twitch-twilight/modules/chat/rich_content.jsx @@ -51,7 +51,7 @@ export default class RichContent extends Module { if ( ! data ) data = { error: true, - title: t.i18n.t('card.error', 'An error occured.'), + title: t.i18n.t('card.error', 'An error occurred.'), desc_1: t.i18n.t('card.empty', 'No data was returned.') } @@ -68,7 +68,7 @@ export default class RichContent extends Module { loaded: true, error: true, url: this.props.url, - title: t.i18n.t('card.error', 'An error occured.'), + title: t.i18n.t('card.error', 'An error occurred.'), desc_1: String(err) }); }