Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed May 3, 2024
1 parent 0e5c558 commit 6122878
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions client/src/www/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions client/src/www/model/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 6122878

Please sign in to comment.