diff --git a/client/src/www/app/app.ts b/client/src/www/app/app.ts index 6c41298868..ae84354d1e 100644 --- a/client/src/www/app/app.ts +++ b/client/src/www/app/app.ts @@ -223,6 +223,8 @@ export class App { } else if (error instanceof errors.SessionProviderError) { toastMessage = error.message; buttonMessage = this.localize('error-details'); + + console.log(error, error.message, error.details); buttonHandler = () => { this.showErrorDetailsDialog(error.details); }; diff --git a/client/src/www/app/outline_server_repository/access_key_serialization.ts b/client/src/www/app/outline_server_repository/access_key_serialization.ts index ecf6df1e67..035ed437b0 100644 --- a/client/src/www/app/outline_server_repository/access_key_serialization.ts +++ b/client/src/www/app/outline_server_repository/access_key_serialization.ts @@ -39,7 +39,7 @@ function parseShadowsocksSessionConfigJson(responseBody: string): ShadowsocksSes const responseJson = JSON.parse(responseBody); if ('error' in responseJson) { - throw new errors.SessionProviderError(responseJson.error.message, { details: responseJson.error.details }); + throw new errors.SessionProviderError(responseJson.error.message, responseJson.error.details); } const {method, password, server, server_port, prefix} = responseJson; @@ -85,7 +85,7 @@ export async function fetchShadowsocksSessionConfig(configLocation: URL): Promis return parseShadowsocksSessionConfigJson(responseBody); } catch (cause) { - if (cause instanceof errors.SessionConfigError) { + if (cause instanceof errors.SessionProviderError) { throw cause; } diff --git a/client/src/www/model/errors.ts b/client/src/www/model/errors.ts index 41db439808..8167bbe29f 100644 --- a/client/src/www/model/errors.ts +++ b/client/src/www/model/errors.ts @@ -55,10 +55,10 @@ export class SessionConfigError extends CustomError { export class SessionProviderError extends CustomError { readonly details: string | undefined; - constructor(message: string, options?: {details?: string}) { + constructor(message: string, details?: string) { super(message); - this.details = options && options.details; + this.details = details; } }