Error message if upload is not possible (#1353)

This commit is contained in:
Francesco Spissu
2022-08-26 11:24:03 +02:00
committed by GitHub
parent fc9107c084
commit 0c22884729
3 changed files with 13 additions and 5 deletions

View File

@@ -222,6 +222,12 @@ export abstract class CoreServiceContribution extends SketchContribution {
} catch {}
}
if (message) {
if (message.includes('Missing FQBN (Fully Qualified Board Name)')) {
message = nls.localize(
'arduino/coreContribution/noBoardSelected',
'No board selected. Please select your Arduino board from the Tools > Board menu.'
);
}
const copyAction = nls.localize(
'arduino/coreContribution/copyError',
'Copy error messages'

View File

@@ -61,10 +61,11 @@ export class UploadSketch extends CoreServiceContribution {
registry.registerCommand(UploadSketch.Commands.UPLOAD_SKETCH, {
execute: async () => {
const key = this.selectedFqbnAddress();
if (!key) {
return;
}
if (this.boardRequiresUserFields && !this.cachedUserFields.has(key)) {
if (
this.boardRequiresUserFields &&
key &&
!this.cachedUserFields.has(key)
) {
// Deep clone the array of board fields to avoid editing the cached ones
this.userFieldsDialog.value = (
await this.boardsServiceProvider.selectedBoardUserFields()