diff --git a/src/ScalarAuthClient.js b/src/ScalarAuthClient.js index 8216f20314..67607b4996 100644 --- a/src/ScalarAuthClient.js +++ b/src/ScalarAuthClient.js @@ -32,6 +32,8 @@ class ScalarAuthClient { }, (err, response, body) => { if (err) { defer.reject(err); + } else if (response.statusCode / 100 !== 2) { + defer.reject({statusCode: response.statusCode}); } else { defer.resolve(body.access_token); } diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index dc1c89d11d..5a6453aaa0 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -60,6 +60,8 @@ module.exports = React.createClass({ tags: tags, areNotifsMuted: areNotifsMuted, isRoomPublished: this._originalIsRoomPublished, // loaded async in componentWillMount + scalar_token: null, + scalar_error: null, }; }, @@ -75,6 +77,8 @@ module.exports = React.createClass({ this.getScalarToken().done((token) => { this.setState({scalar_token: token}); + }, (err) => { + this.setState({scalar_error: err}); }); dis.dispatch({ @@ -578,6 +582,10 @@ module.exports = React.createClass({ Manage integrations ); + } else if (this.state.scalar_error) { + integrations_section =
+ Unable to contact integrations server +
; } else { integrations_section = ; }