Sensible error message if we can't invite because we're not allowed
This commit is contained in:
parent
7caad2a434
commit
88aa975271
1 changed files with 11 additions and 4 deletions
|
@ -231,10 +231,17 @@ module.exports = React.createClass({
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (err !== null) {
|
if (err !== null) {
|
||||||
console.error("Failed to invite: %s", JSON.stringify(err));
|
console.error("Failed to invite: %s", JSON.stringify(err));
|
||||||
Modal.createDialog(ErrorDialog, {
|
if (err.errcode == 'M_FORBIDDEN') {
|
||||||
title: "Server error whilst inviting",
|
Modal.createDialog(ErrorDialog, {
|
||||||
description: err.message
|
title: "Unable to Invite",
|
||||||
});
|
description: "You do not have permission to invite people to this room."
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Modal.createDialog(ErrorDialog, {
|
||||||
|
title: "Server error whilst inviting",
|
||||||
|
description: err.message
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).finally(function() {
|
}).finally(function() {
|
||||||
self.setState({
|
self.setState({
|
||||||
|
|
Loading…
Reference in a new issue