mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-14 10:00:53 +00:00
4.0.0-rc13.16.1
* Fixed: Better error handling when the link information service doesn't return information for a link.
This commit is contained in:
parent
199b9c9315
commit
842ee0d9eb
2 changed files with 19 additions and 3 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue