Merge pull request #1333 from matrix-org/dbkr/fix_uncaught_exception_if_no_scalar

Catch the promise rejection if scalar fails
This commit is contained in:
David Baker 2017-08-24 09:45:51 +01:00 committed by GitHub
commit 737a258944

View file

@ -53,11 +53,11 @@ module.exports = React.createClass({
this.scalarClient = null;
if (SdkConfig.get().integrations_ui_url && SdkConfig.get().integrations_rest_url) {
this.scalarClient = new ScalarAuthClient();
this.scalarClient.connect().done(() => {
this.scalarClient.connect().then(() => {
this.forceUpdate();
}).catch((e) => {
console.log("Failed to connect to integrations server");
// TODO -- Handle Scalar errors
// },
// (err) => {
// this.setState({
// scalar_error: err,
// });