Skip to content

Commit

Permalink
fix sloppyness
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed May 1, 2024
1 parent d461bc5 commit 2a7b60d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions client/src/www/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class App {
toastMessage = error.message;
buttonMessage = this.localize('error-details');
buttonHandler = () => {
this.showErrorDetailDialog(error);
this.showErrorDetailsDialog(error.details);
};
} else {
const hasErrorDetails = Boolean(error.message || error.cause);
Expand Down Expand Up @@ -587,15 +587,13 @@ export class App {
message += error.cause.toString();
}

// Temporarily use window.alert here
return alert(message);
}

private showErrorDetailDialog(error: errors.SessionProviderError) {
if (!error.details) return;
private showErrorDetailsDialog(details: string) {
if (!details) return;

// Temporarily use window.alert here
return alert(error.details);
return alert(details);
}

//#endregion UI dialogs
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.SessionConfigError(responseJson.error.message, { cause: responseJson.error.details });
throw new errors.SessionProviderError(responseJson.error.message, { details: responseJson.error.details });
}

const {method, password, server, server_port, prefix} = responseJson;
Expand Down

0 comments on commit 2a7b60d

Please sign in to comment.