Merge pull request #3102 from matrix-org/dbkr/nonfatal_errors_are_not_fatal

Allow changing servers on nonfatal errors
This commit is contained in:
David Baker 2019-06-13 18:39:43 +01:00 committed by GitHub
commit 2a7301fa8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,16 +101,25 @@ export default class ServerConfig extends React.PureComponent {
return result;
} catch (e) {
console.error(e);
let message = _t("Unable to validate homeserver/identity server");
if (e.translatedMessage) {
message = e.translatedMessage;
}
this.setState({
busy: false,
errorText: message,
});
return null;
const stateForError = AutoDiscoveryUtils.authComponentStateForError(e);
if (!stateForError.isFatalError) {
// carry on anyway
const result = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(hsUrl, isUrl, true);
this.props.onServerConfigChange(result);
return result;
} else {
let message = _t("Unable to validate homeserver/identity server");
if (e.translatedMessage) {
message = e.translatedMessage;
}
this.setState({
busy: false,
errorText: message,
});
return null;
}
}
}