diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 2aee97db72..f8a3d9e981 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -161,7 +161,7 @@ module.exports = React.createClass({ var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failed to get public room list", - description: "The server may be unavailable or overloaded", + description: ((err && err.message) ? err.message : "The server may be unavailable or overloaded"), }); }); }, @@ -209,8 +209,8 @@ module.exports = React.createClass({ this.refreshRoomList(); console.error("Failed to " + step + ": " + err); Modal.createDialog(ErrorDialog, { - title: "Error", - description: "Failed to " + step, + title: "Failed to " + step, + description: ((err && err.message) ? err.message : "The server may be unavailable or overloaded"), }); }); } diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 2898de2d46..577dac9c8f 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -456,8 +456,8 @@ var RoomSubList = React.createClass({ var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to add tag " + self.props.tagName + " to room" + err); Modal.createDialog(ErrorDialog, { - title: "Error", - description: "Failed to add tag " + self.props.tagName + " to room", + title: "Failed to add tag " + self.props.tagName + " to room", + description: ((err && err.message) ? err.message : "Operation failed"), }); }); break; diff --git a/src/components/views/context_menus/RoomTileContextMenu.js b/src/components/views/context_menus/RoomTileContextMenu.js index d981a36751..7efa68485c 100644 --- a/src/components/views/context_menus/RoomTileContextMenu.js +++ b/src/components/views/context_menus/RoomTileContextMenu.js @@ -71,7 +71,7 @@ module.exports = React.createClass({ var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failed to remove tag " + tagNameOff + " from room", - description: err.toString() + description: ((err && err.message) ? err.message : "Operation failed"), }); }); } @@ -88,7 +88,7 @@ module.exports = React.createClass({ var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failed to add tag " + tagNameOn + " to room", - description: err.toString() + description: ((err && err.message) ? err.message : "Operation failed"), }); }); } @@ -149,7 +149,7 @@ module.exports = React.createClass({ var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failed to set Direct Message status of room", - description: err.toString() + description: ((err && err.message) ? err.message : "Operation failed"), }); }); }, @@ -187,8 +187,8 @@ module.exports = React.createClass({ var errCode = err.errcode || "unknown error code"; var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { - title: "Error", - description: `Failed to forget room (${errCode})` + title: `Failed to forget room (${errCode})`, + description: ((err && err.message) ? err.message : "Operation failed"), }); }); diff --git a/src/components/views/rooms/DNDRoomTile.js b/src/components/views/rooms/DNDRoomTile.js index 2fcdb47da3..4bcf29ed9a 100644 --- a/src/components/views/rooms/DNDRoomTile.js +++ b/src/components/views/rooms/DNDRoomTile.js @@ -90,8 +90,8 @@ var roomTileSource = { const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to set direct chat tag " + err); Modal.createDialog(ErrorDialog, { - title: "Error", - description: "Failed to set direct chat tag", + title: "Failed to set direct chat tag", + description: ((err && err.message) ? err.message : "Operation failed"), }); }); return; @@ -115,8 +115,8 @@ var roomTileSource = { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to remove tag " + prevTag + " from room: " + err); Modal.createDialog(ErrorDialog, { - title: "Error", - description: "Failed to remove tag " + prevTag + " from room", + title: "Failed to remove tag " + prevTag + " from room", + description: ((err && err.message) ? err.message : "Operation failed"), }); }); } @@ -137,8 +137,8 @@ var roomTileSource = { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to add tag " + newTag + " to room: " + err); Modal.createDialog(ErrorDialog, { - title: "Error", - description: "Failed to add tag " + newTag + " to room", + title: "Failed to add tag " + newTag + " to room", + description: ((err && err.message) ? err.message : "Operation failed"), }); }); } diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index b685c1f321..11dc79ac20 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -240,8 +240,8 @@ module.exports = React.createClass({ var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to change settings: " + error); Modal.createDialog(ErrorDialog, { - title: "Error", - description: "Failed to change settings", + title: "Failed to change settings", + description: ((error && error.message) ? error.message : "Operation failed"), onFinished: self._refreshFromServer }); }); @@ -310,8 +310,8 @@ module.exports = React.createClass({ var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Can't update user notification settings: " + error); Modal.createDialog(ErrorDialog, { - title: "Error", - description: "Can't update user notification settings", + title: "Can't update user notification settings", + description: ((error && error.message) ? error.message : "Operation failed"), onFinished: self._refreshFromServer }); }); @@ -352,8 +352,8 @@ module.exports = React.createClass({ var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to update keywords: " + error); Modal.createDialog(ErrorDialog, { - title: "Error", - description: "Failed to update keywords", + title: "Failed to update keywords", + description: ((error && error.message) ? error.message : "Operation failed"), onFinished: self._refreshFromServer }); }