Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 372a820

Browse files
Remove gRPC error code from error notifications
1 parent f0d9894 commit 372a820

File tree

4 files changed

+30
-9
lines changed

4 files changed

+30
-9
lines changed

‎arduino-ide-extension/src/browser/contributions/burn-bootloader.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ export class BurnBootloader extends SketchContribution {
7979
}
8080
);
8181
} catch (e) {
82-
this.messageService.error(e.toString());
82+
let errorMessage = "";
83+
if (typeof e === "string") {
84+
errorMessage = e;
85+
} else {
86+
errorMessage = e.toString();
87+
}
88+
this.messageService.error(errorMessage);
8389
} finally {
8490
if (this.serialConnection.isSerialOpen()) {
8591
await this.serialConnection.connect();

‎arduino-ide-extension/src/browser/contributions/upload-sketch.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,13 @@ export class UploadSketch extends SketchContribution {
277277
{ timeout: 3000 }
278278
);
279279
} catch (e) {
280-
this.messageService.error(e.toString());
280+
let errorMessage = "";
281+
if (typeof e === "string") {
282+
errorMessage = e;
283+
} else {
284+
errorMessage = e.toString();
285+
}
286+
this.messageService.error(errorMessage);
281287
} finally {
282288
this.uploadInProgress = false;
283289
this.onDidChangeEmitter.fire();

‎arduino-ide-extension/src/browser/contributions/verify-sketch.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,13 @@ export class VerifySketch extends SketchContribution {
127127
{ timeout: 3000 }
128128
);
129129
} catch (e) {
130-
this.messageService.error(e.toString());
130+
let errorMessage = "";
131+
if (typeof e === "string") {
132+
errorMessage = e;
133+
} else {
134+
errorMessage = e.toString();
135+
}
136+
this.messageService.error(errorMessage);
131137
} finally {
132138
this.verifyInProgress = false;
133139
this.onDidChangeEmitter.fire();

‎arduino-ide-extension/src/node/core-service-impl.ts‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
8585
chunk: '\n--------------------------\nCompilation complete.\n',
8686
});
8787
} catch (e) {
88+
const errorMessage = `Compilation error: ${e.details}`
8889
this.responseService.appendToOutput({
89-
chunk: `Compilation error: ${e.details}\n`,
90+
chunk: `${errorMessage}}\n`,
9091
severity: 'error',
9192
});
92-
throw e;
93+
throw newError(errorMessage);
9394
}
9495
}
9596

@@ -180,11 +181,12 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
180181
' complete.\n',
181182
});
182183
} catch (e) {
184+
const errorMessage = `${firstToUpperCase(task)} error: ${e.details}`;
183185
this.responseService.appendToOutput({
184-
chunk: `${firstToUpperCase(task)} error: ${e.details}\n`,
186+
chunk: `${errorMessage}\n`,
185187
severity: 'error',
186188
});
187-
throw e;
189+
throw newError(errorMessage);
188190
} finally {
189191
this.uploading = false;
190192
}
@@ -227,11 +229,12 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
227229
result.on('end', () => resolve());
228230
});
229231
} catch (e) {
232+
const errorMessage = `Error while burning the bootloader: ${e.details}`;
230233
this.responseService.appendToOutput({
231-
chunk: `Error while burning the bootloader: ${e.details}\n`,
234+
chunk: `${errorMessage}\n`,
232235
severity: 'error',
233236
});
234-
throw e;
237+
throw newError(errorMessage);
235238
}
236239
}
237240

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /