Skip to content

Commit

Permalink
Throwing error regardless
Browse files Browse the repository at this point in the history
  • Loading branch information
ymao1 committed Jan 23, 2023
1 parent 9d48b9f commit 6b74e18
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ export class AlertsService implements IAlertsService {
installFn: () => Promise<void>,
timeoutMs: number = INSTALLATION_TIMEOUT
): Promise<void> {
let serverStopped: boolean = false;
try {
let timeoutId: NodeJS.Timeout;
const install = async (): Promise<void> => {
Expand All @@ -497,7 +496,6 @@ export class AlertsService implements IAlertsService {

firstValueFrom(this.options.pluginStop$).then(() => {
clearTimeout(timeoutId);
serverStopped = true;
reject(new Error('Server is stopping; must stop all async operations'));
});
});
Expand All @@ -507,10 +505,8 @@ export class AlertsService implements IAlertsService {
} catch (e) {
this.options.logger.error(e);

if (!serverStopped) {
const reason = e?.message || 'Unknown reason';
throw new Error(`Failure during installation. ${reason}`);
}
const reason = e?.message || 'Unknown reason';
throw new Error(`Failure during installation. ${reason}`);
}
}
}

0 comments on commit 6b74e18

Please sign in to comment.