beautify all error msgs

pull/3424/head
Matthew Hodgson 2017-03-12 23:26:26 +00:00
parent 0a0293d8fb
commit d639eb1049
5 changed files with 30 additions and 20 deletions

View File

@ -208,9 +208,10 @@ module.exports = React.createClass({
}, function(err) { }, function(err) {
modal.close(); modal.close();
this.refreshRoomList(); this.refreshRoomList();
console.error("Failed to " + step + ": " + err);
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: "Failed to "+step, title: "Error",
description: err.toString() description: "Failed to " + step,
}); });
}); });
} }

View File

@ -505,9 +505,10 @@ var RoomSubList = React.createClass({
// Do any final stuff here // Do any final stuff here
}).fail(function(err) { }).fail(function(err) {
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Failed to add tag " + self.props.tagName + " to room" + err);
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: "Failed to add tag " + self.props.tagName + " to room", title: "Error",
description: err.toString() description: "Failed to add tag " + self.props.tagName + " to room",
}); });
}); });
break; break;

View File

@ -58,9 +58,10 @@ module.exports = React.createClass({
}; };
}).fail(function(err) { }).fail(function(err) {
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Failed to remove tag " + tagNameOff + " from room: " + err);
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: "Failed to remove tag " + tagNameOff + " from room", title: "Error",
description: err.toString() description: "Failed to remove tag " + tagNameOff + " from room",
}); });
}); });
} }
@ -75,9 +76,10 @@ module.exports = React.createClass({
}; };
}).fail(function(err) { }).fail(function(err) {
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Failed to add tag " + tagNameOn + " to room: " + err);
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: "Failed to add tag " + tagNameOn + " to room", title: "Error",
description: err.toString() description: "Failed to add tag " + tagNameOn + " to room",
}); });
}); });
} }
@ -148,9 +150,10 @@ module.exports = React.createClass({
}; };
}, (err) => { }, (err) => {
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Failed to set DM status of room: " + err);
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: "Failed to set Direct Message status of room", title: "Error",
description: err.toString() description: "Failed to set Direct Message status of room",
}); });
}); });
}); });

View File

@ -84,9 +84,10 @@ var roomTileSource = {
//component.state.set({ spinner: component.state.spinner-- }); //component.state.set({ spinner: component.state.spinner-- });
}).fail(function(err) { }).fail(function(err) {
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Failed to remove tag " + item.originalList.props.tagName + " from room: " + err);
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: "Failed to remove tag " + item.originalList.props.tagName + " from room", title: "Error",
description: err.toString() description: "Failed to remove tag " + item.originalList.props.tagName + " from room",
}); });
}); });
} }
@ -103,9 +104,10 @@ var roomTileSource = {
//component.state.set({ spinner: component.state.spinner-- }); //component.state.set({ spinner: component.state.spinner-- });
}).fail(function(err) { }).fail(function(err) {
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Failed to add tag " + item.targetList.props.tagName + " to room: " + err);
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: "Failed to add tag " + item.targetList.props.tagName + " to room", title: "Error",
description: err.toString() description: "Failed to add tag " + item.targetList.props.tagName + " to room",
}); });
}); });
} }

View File

@ -238,9 +238,10 @@ module.exports = React.createClass({
self._refreshFromServer(); self._refreshFromServer();
}, function(error) { }, function(error) {
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Failed to change settings: " + error);
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: "Can't change settings", title: "Error",
description: error.toString(), description: "Failed to change settings",
onFinished: self._refreshFromServer onFinished: self._refreshFromServer
}); });
}); });
@ -307,9 +308,10 @@ module.exports = React.createClass({
self._refreshFromServer(); self._refreshFromServer();
}, function(error) { }, function(error) {
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Can't update user notification settings: " + error);
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: "Can't update user notification settings", title: "Error",
description: error.toString(), description: "Can't update user notification settings",
onFinished: self._refreshFromServer onFinished: self._refreshFromServer
}); });
}); });
@ -348,9 +350,10 @@ module.exports = React.createClass({
var onError = function(error) { var onError = function(error) {
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Failed to update keywords: " + error);
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: "Can't update keywords", title: "Error",
description: error.toString(), description: "Failed to update keywords",
onFinished: self._refreshFromServer onFinished: self._refreshFromServer
}); });
} }