Skip to content

Commit 5445632

Browse files
committed
Use new js-sdk properties for getting discovery errors
Requires matrix-org/matrix-js-sdk#899
1 parent f08491c commit 5445632

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

‎src/vector/index.js‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -448,20 +448,6 @@ async function loadLanguage() {
448448
async function verifyServerConfig() {
449449
console.log("Verifying homeserver configuration");
450450

451-
// Errors which can be returned by .well-known lookups. If autodiscovery fails for unexpected reasons,
452-
// the last thing we want is "missing-translation|en:Your error here". The actual strings are also defined
453-
// in the react-sdk, so we don't need them here.
454-
const discoveryErrors = [
455-
"Invalid homeserver discovery response",
456-
"Failed to get autodiscovery configuration from server",
457-
"Invalid base_url for m.homeserver",
458-
"Homeserver URL does not appear to be a valid Matrix homeserver",
459-
"Invalid identity server discovery response",
460-
"Invalid base_url for m.identity_server",
461-
"Identity server URL does not appear to be a valid identity server",
462-
"General failure",
463-
];
464-
465451
const config = SdkConfig.get();
466452
let wkConfig = config['default_server_config']; // overwritten later under some conditions
467453
const serverName = config['default_server_name'];
@@ -512,7 +498,7 @@ async function verifyServerConfig() {
512498

513499
const hsResult = result['m.homeserver'];
514500
if (hsResult.state !== AutoDiscovery.SUCCESS) {
515-
if (discoveryErrors.indexOf(hsResult.error) !== -1) {
501+
if (AutoDiscovery.ALL_ERRORS.indexOf(hsResult.error) !== -1) {
516502
throw newTranslatableError(hsResult.error);
517503
}
518504
throw newTranslatableError(_td("Unexpected error resolving homeserver configuration"));

0 commit comments

Comments
 (0)