Remove gRPC error code from error notifications

This commit is contained in:
Silvano Cerza
2021-12-03 15:23:49 +01:00
committed by Silvano Cerza
parent f0d9894a16
commit 5ddab1ded7
5 changed files with 53 additions and 9 deletions

View File

@@ -79,7 +79,13 @@ export class BurnBootloader extends SketchContribution {
}
);
} catch (e) {
this.messageService.error(e.toString());
let errorMessage = "";
if (typeof e === "string") {
errorMessage = e;
} else {
errorMessage = e.toString();
}
this.messageService.error(errorMessage);
} finally {
if (this.serialConnection.isSerialOpen()) {
await this.serialConnection.connect();

View File

@@ -277,7 +277,13 @@ export class UploadSketch extends SketchContribution {
{ timeout: 3000 }
);
} catch (e) {
this.messageService.error(e.toString());
let errorMessage = "";
if (typeof e === "string") {
errorMessage = e;
} else {
errorMessage = e.toString();
}
this.messageService.error(errorMessage);
} finally {
this.uploadInProgress = false;
this.onDidChangeEmitter.fire();

View File

@@ -127,7 +127,13 @@ export class VerifySketch extends SketchContribution {
{ timeout: 3000 }
);
} catch (e) {
this.messageService.error(e.toString());
let errorMessage = "";
if (typeof e === "string") {
errorMessage = e;
} else {
errorMessage = e.toString();
}
this.messageService.error(errorMessage);
} finally {
this.verifyInProgress = false;
this.onDidChangeEmitter.fire();