diff --git a/objects/handlers/ProviderHandler.js b/objects/handlers/ProviderHandler.js index 48ee645..558f701 100644 --- a/objects/handlers/ProviderHandler.js +++ b/objects/handlers/ProviderHandler.js @@ -99,7 +99,14 @@ class ProviderHandler { if (!cache[i].flux) { DataValidator.onDataUpload(cache[i]); - await UI.indicator(flux.upload(cache[i]), 'providers-flux-uploading'); + + try { + await UI.indicator(flux.upload(cache[i]), 'providers-flux-uploading'); + } + catch(err) { + console.error(err); + UI.status('providers-flux-upload-error'); + } } DataValidator.onDataStore(cache[i]); diff --git a/objects/i18n/locales/en.json b/objects/i18n/locales/en.json index 829605e..a5bbd82 100644 --- a/objects/i18n/locales/en.json +++ b/objects/i18n/locales/en.json @@ -98,6 +98,7 @@ "providers-error-outdated": "%s: Data is outdated!", "providers-error-perks": "Could not gather perks for %s (%s)", "providers-flux-uploading": "Uploading data to Flu.x", + "providers-flux-upload-error": "Couldn't upload data to Flu.x", "providers-order": "Providers order", "providers-skipped": "%s has been skipped because of missing function: #%s", "reset-settings-button": "Reset", diff --git a/objects/i18n/locales/fr.json b/objects/i18n/locales/fr.json index 3d46491..c752bc8 100644 --- a/objects/i18n/locales/fr.json +++ b/objects/i18n/locales/fr.json @@ -98,6 +98,7 @@ "providers-error-outdated": "%s: les données ne sont pas à jour pour le dernier patch", "providers-error-perks": "Could not gather runes for %s (%s)", "providers-flux-uploading": "Téléversement des données vers Flu.x", + "providers-flux-upload-error": "Une erreur est survenue lors du téléversement", "providers-order": "Ordre des fournisseurs", "providers-skipped": "%s à été sauté à cause d'une méthode manquante: #%s", "reset-settings-button": "Réinitialiser", diff --git a/objects/providers/Flux.js b/objects/providers/Flux.js index 13b052f..0526f5e 100644 --- a/objects/providers/Flux.js +++ b/objects/providers/Flux.js @@ -46,7 +46,7 @@ class FluxProvider extends Provider { * @param {object} data - The data that contains perks, summonerspells etc */ async upload(data) { - if (Object.values(data.roles).some(x => Array.isArray(x) && x.length === 0)) return console.log(2, 'Upload cancelled: missing data'); + if (Object.values(data.roles).some(x => Array.isArray(x) && x.length === 0)) return console.log(2, '[Flu.x] Upload cancelled: missing data'); if (data.flux) return; return await rp({