Skip to content

Commit 0c22884

Browse files
Error message if upload is not possible (#1353)
1 parent fc9107c commit 0c22884

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

Diff for: arduino-ide-extension/src/browser/contributions/contribution.ts

+6
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@ export abstract class CoreServiceContribution extends SketchContribution {
222222
} catch {}
223223
}
224224
if (message) {
225+
if (message.includes('Missing FQBN (Fully Qualified Board Name)')) {
226+
message = nls.localize(
227+
'arduino/coreContribution/noBoardSelected',
228+
'No board selected. Please select your Arduino board from the Tools > Board menu.'
229+
);
230+
}
225231
const copyAction = nls.localize(
226232
'arduino/coreContribution/copyError',
227233
'Copy error messages'

Diff for: arduino-ide-extension/src/browser/contributions/upload-sketch.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ export class UploadSketch extends CoreServiceContribution {
6161
registry.registerCommand(UploadSketch.Commands.UPLOAD_SKETCH, {
6262
execute: async () => {
6363
const key = this.selectedFqbnAddress();
64-
if (!key) {
65-
return;
66-
}
67-
if (this.boardRequiresUserFields && !this.cachedUserFields.has(key)) {
64+
if (
65+
this.boardRequiresUserFields &&
66+
key &&
67+
!this.cachedUserFields.has(key)
68+
) {
6869
// Deep clone the array of board fields to avoid editing the cached ones
6970
this.userFieldsDialog.value = (
7071
await this.boardsServiceProvider.selectedBoardUserFields()

Diff for: i18n/en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@
132132
"replaceTitle": "Replace"
133133
},
134134
"coreContribution": {
135-
"copyError": "Copy error messages"
135+
"copyError": "Copy error messages",
136+
"noBoardSelected": "No board selected. Please select your Arduino board from the Tools > Board menu."
136137
},
137138
"daemon": {
138139
"restart": "Restart Daemon",

0 commit comments

Comments
 (0)