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) {
modal.close();
this.refreshRoomList();
console.error("Failed to " + step + ": " + err);
Modal.createDialog(ErrorDialog, {
title: "Failed to "+step,
description: err.toString()
title: "Error",
description: "Failed to " + step,
});
});
}

View File

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

View File

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

View File

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

View File

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