From 9c5ceb677592a28cf69dc6f1156ff35b88b20eb8 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 10 Aug 2017 13:56:01 +0100 Subject: [PATCH] don't track error messages Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/RoomDirectory.js | 6 +++--- src/components/structures/RoomSubList.js | 2 +- src/components/views/context_menus/RoomTileContextMenu.js | 8 ++++---- src/components/views/rooms/DNDRoomTile.js | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index fd870a97..e160b780 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -82,7 +82,7 @@ module.exports = React.createClass({ return; } const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Failed to get protocol list from Home Server', err.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to get protocol list from Home Server', '', ErrorDialog, { title: _t('Failed to get protocol list from Home Server'), description: _t('The Home Server may be too old to support third party networks'), }); @@ -178,7 +178,7 @@ module.exports = React.createClass({ this.setState({ loading: false }); console.error("Failed to get publicRooms: %s", JSON.stringify(err)); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Failed to get public room list', err.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to get public room list', '', ErrorDialog, { title: _t('Failed to get public room list'), description: ((err && err.message) ? err.message : _t('The server may be unavailable or overloaded')) }); @@ -227,7 +227,7 @@ module.exports = React.createClass({ modal.close(); this.refreshRoomList(); console.error("Failed to " + step + ": " + err); - Modal.createTrackedDialog('Remove from Directory Error', err.toString(), ErrorDialog, { + Modal.createTrackedDialog('Remove from Directory Error', '', ErrorDialog, { title: _t('Error'), description: ((err && err.message) ? err.message : _t('The server may be unavailable or overloaded')) }); diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index afbde398..7c6b1622 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -514,7 +514,7 @@ var RoomSubList = React.createClass({ }).catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to add tag " + self.props.tagName + " to room" + err); - Modal.createTrackedDialog('Failed to add tag to room', err.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to add tag to room', '', ErrorDialog, { title: _t('Failed to add tag %(tagName)s to room', {tagName: self.props.tagName}), description: ((err && err.message) ? err.message : _t('Operation failed')), }); diff --git a/src/components/views/context_menus/RoomTileContextMenu.js b/src/components/views/context_menus/RoomTileContextMenu.js index e6bccb0a..c9ded5f4 100644 --- a/src/components/views/context_menus/RoomTileContextMenu.js +++ b/src/components/views/context_menus/RoomTileContextMenu.js @@ -70,7 +70,7 @@ module.exports = React.createClass({ }; }).catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Failed to remove tag from room 1', err.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to remove tag from room 1', '', ErrorDialog, { title: _t('Failed to remove tag %(tagName)s from room', {tagName: tagNameOff}), description: ((err && err.message) ? err.message : _t('Operation failed')), }); @@ -87,7 +87,7 @@ module.exports = React.createClass({ }; }).catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Failed to remove tag from room 2', err.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to remove tag from room 2', '', ErrorDialog, { title: _t('Failed to remove tag %(tagName)s from room', {tagName: tagNameOn}), description: ((err && err.message) ? err.message : _t('Operation failed')), }); @@ -148,7 +148,7 @@ module.exports = React.createClass({ }; }, (err) => { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Failed to set Direct Message status of room', err.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to set Direct Message status of room', '', ErrorDialog, { title: _t('Failed to set Direct Message status of room'), description: ((err && err.message) ? err.message : _t('Operation failed')), }); @@ -187,7 +187,7 @@ module.exports = React.createClass({ }, function(err) { var errCode = err.errcode || "unknown error code"; var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Failed to forget room', err.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to forget room', '', ErrorDialog, { title: _t('Failed to forget room %(errCode)s', {errCode: errCode}), description: ((err && err.message) ? err.message : _t('Operation failed')), }); diff --git a/src/components/views/rooms/DNDRoomTile.js b/src/components/views/rooms/DNDRoomTile.js index 9ef934f8..430906d2 100644 --- a/src/components/views/rooms/DNDRoomTile.js +++ b/src/components/views/rooms/DNDRoomTile.js @@ -89,7 +89,7 @@ var roomTileSource = { }, (err) => { const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to set direct chat tag " + err); - Modal.createTrackedDialog('Failed to set direct chat tag', err.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to set direct chat tag', '', ErrorDialog, { title: _t('Failed to set direct chat tag'), description: ((err && err.message) ? err.message : _t('Operation failed')), }); @@ -114,7 +114,7 @@ var roomTileSource = { }).catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to remove tag " + prevTag + " from room: " + err); - Modal.createTrackedDialog('Failed to remove tag from room', err.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to remove tag from room', '', ErrorDialog, { title: _t('Failed to remove tag %(tagName)s from room', {tagName: prevTag}), description: ((err && err.message) ? err.message : _t('Operation failed')), }); @@ -133,7 +133,7 @@ var roomTileSource = { MatrixClientPeg.get().setRoomTag(item.room.roomId, newTag, newOrder).catch(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to add tag " + newTag + " to room: " + err); - Modal.createTrackedDialog('Failed to add tag to room', err.toString(), ErrorDialog, { + Modal.createTrackedDialog('Failed to add tag to room', '', ErrorDialog, { title: _t('Failed to add tag %(tagName)s to room', {tagName: newTag}), description: ((err && err.message) ? err.message : _t('Operation failed')), });