Small FE improvements
This commit is contained in:
parent
c62ec9b98b
commit
f2326b846e
1 changed files with 39 additions and 11 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import { SUPPORTED_API_VERSION } from "../consts";
|
||||
import { AuthenticationError } from "./authentication-error";
|
||||
import { ServerVersionMismatchError } from "./server-version-mismatch-error";
|
||||
import {
|
||||
AuthenticationError,
|
||||
ServerVersionMismatchError
|
||||
} from "../errors/errors";
|
||||
import type { SyncService } from "./sync-service";
|
||||
import type { PingResponse } from "./types/PingResponse";
|
||||
|
||||
|
|
@ -74,7 +76,12 @@ export class ServerConfig {
|
|||
public async getConfig(): Promise<ServerConfigData> {
|
||||
if (!this.config) {
|
||||
this.response ??= this.syncService.ping();
|
||||
this.config = await this.response;
|
||||
try {
|
||||
this.config = await this.response;
|
||||
} catch (error) {
|
||||
this.response = undefined;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
ServerConfig.validateConfig(this.config);
|
||||
|
|
|
|||
Loading…
Reference in a new issue