diff --git a/i18n/en.pot b/i18n/en.pot index a591ac3402..9c46811c1a 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -842,6 +842,16 @@ msgstr "" msgid "Something went wrong" msgstr "Something went wrong" +msgid "" +"There's a problem with the generated analytics. Contact a system " +"administrator." +msgstr "" +"There's a problem with the generated analytics. Contact a system " +"administrator." + +msgid "There's a syntax problem with the analytics request." +msgstr "There's a syntax problem with the analytics request." + msgid "or" msgstr "or" diff --git a/src/components/Visualization/Visualization.js b/src/components/Visualization/Visualization.js index 0b67d8a528..c619c23760 100644 --- a/src/components/Visualization/Visualization.js +++ b/src/components/Visualization/Visualization.js @@ -19,6 +19,8 @@ import { NoOrgUnitResponseError, NoDataError, ValueTypeError, + AnalyticsGenerationError, + AnalyticsRequestError, } from '../../modules/error.js' import { removeLastPathSegment } from '../../modules/orgUnit.js' import { sGetCurrent } from '../../reducers/current.js' @@ -74,6 +76,12 @@ export class UnconnectedVisualization extends Component { } } break + case 'E7144': + error = new AnalyticsGenerationError() + break + case 'E7145': + error = new AnalyticsRequestError() + break default: error = response } diff --git a/src/modules/error.js b/src/modules/error.js index 7f61a71b5a..07160d1aa9 100644 --- a/src/modules/error.js +++ b/src/modules/error.js @@ -335,6 +335,28 @@ export class ValueTypeError extends VisualizationError { } } +export class AnalyticsGenerationError extends VisualizationError { + constructor() { + super( + GenericError, + i18n.t('Something went wrong'), + i18n.t( + "There's a problem with the generated analytics. Contact a system administrator." + ) + ) + } +} + +export class AnalyticsRequestError extends VisualizationError { + constructor() { + super( + GenericError, + i18n.t('Something went wrong'), + i18n.t("There's a syntax problem with the analytics request.") + ) + } +} + export const genericErrorTitle = i18n.t('Something went wrong') const getAvailableAxesDescription = (visType) => {