Skip to content

Commit 73b96b3

Browse files
committed
TraceServer: Check server status if survived error
There are possible cases where the server process(es) was successfully tree-killed despite timing out or receiving an error. In error cases, simply check if server is 'UP' or otherwise down, trying to update the status bar accordingly. Anyway, the start/stop commands should keep working as expected beyond that error event no matter what. And no matter the error case or scenario, always show the related warning to the user, alongside trying to update that status bar item. Contributes to fixing #8. Signed-off-by: Marco Miller <marco.miller@ericsson.com>
1 parent f8a27c3 commit 73b96b3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/trace-server.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,17 @@ export class TraceServer {
169169
return health.isOk() && status === 'UP';
170170
}
171171

172-
private showError(message: string) {
172+
private async showError(message: string) {
173173
console.error(message);
174174
vscode.window.showErrorMessage(message);
175+
const disclaimer = ' running, despite this error.';
176+
const up = await this.isUp();
177+
if (up) {
178+
vscode.window.showWarningMessage(prefix + ' is still' + disclaimer);
179+
} else {
180+
vscode.window.showWarningMessage(prefix + ' is not' + disclaimer);
181+
}
182+
this.setStatusIfAvailable(up);
175183
}
176184

177185
private showStatus(started: boolean) {

0 commit comments

Comments
 (0)