From 4c6836bc3f67addd6b6668203ba115505f8ab64e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 10 Aug 2017 15:13:30 +0100 Subject: [PATCH] don't track error messages .2 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/RoomDirectory.js | 2 +- src/components/views/context_menus/MessageContextMenu.js | 2 +- src/components/views/elements/ImageView.js | 2 +- src/components/views/settings/Notifications.js | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index e160b780..cd9ac565 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -334,7 +334,7 @@ module.exports = React.createClass({ } }, (e) => { const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Fetching third party location failed', e.toString(), ErrorDialog, { + Modal.createTrackedDialog('Fetching third party location failed', '', ErrorDialog, { title: _t('Fetching third party location failed'), description: _t('Unable to look up room ID from server'), }); diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index ef87dcb9..a0381245 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -99,7 +99,7 @@ module.exports = React.createClass({ const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); // display error message stating you couldn't delete this. const code = e.errcode || e.statusCode; - Modal.createTrackedDialog('You cannot delete this message', e.toString(), ErrorDialog, { + Modal.createTrackedDialog('You cannot delete this message', '', ErrorDialog, { title: _t('Error'), description: _t('You cannot delete this message. (%(code)s)', {code: code}) }); diff --git a/src/components/views/elements/ImageView.js b/src/components/views/elements/ImageView.js index 96803774..e70a5d3b 100644 --- a/src/components/views/elements/ImageView.js +++ b/src/components/views/elements/ImageView.js @@ -76,7 +76,7 @@ module.exports = React.createClass({ var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); // display error message stating you couldn't delete this. var code = e.errcode || e.statusCode; - Modal.createTrackedDialog('You cannot delete this image.', e.toString(), ErrorDialog, { + Modal.createTrackedDialog('You cannot delete this image.', '', ErrorDialog, { title: _t('Error'), description: _t('You cannot delete this image. (%(code)s)', {code: code}) }); diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index 1ca63e1e..a58b5d58 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -131,7 +131,7 @@ module.exports = React.createClass({ this._refreshFromServer(); }, (error) => { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Error saving email notification preferences', error.toString(), ErrorDialog, { + Modal.createTrackedDialog('Error saving email notification preferences', '', ErrorDialog, { title: _t('Error saving email notification preferences'), description: _t('An error occurred whilst saving your email notification preferences.'), }); @@ -241,7 +241,7 @@ module.exports = React.createClass({ }, function(error) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to change settings: " + error); - Modal.createTrackedDialog('Failed to change settings', error.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to change settings', '', ErrorDialog, { title: _t('Failed to change settings'), description: ((error && error.message) ? error.message : _t('Operation failed')), onFinished: self._refreshFromServer @@ -311,7 +311,7 @@ module.exports = React.createClass({ }, function(error) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Can't update user notification settings: " + error); - Modal.createTrackedDialog('Can\'t update user notifcation settings', error.toString(), ErrorDialog, { + Modal.createTrackedDialog('Can\'t update user notifcation settings', '', ErrorDialog, { title: _t('Can\'t update user notification settings'), description: ((error && error.message) ? error.message : _t('Operation failed')), onFinished: self._refreshFromServer @@ -353,7 +353,7 @@ module.exports = React.createClass({ var onError = function(error) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to update keywords: " + error); - Modal.createTrackedDialog('Failed to update keywords', error.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to update keywords', '', ErrorDialog, { title: _t('Failed to update keywords'), description: ((error && error.message) ? error.message : _t('Operation failed')), onFinished: self._refreshFromServer