Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cc16f9c

Browse files
committedFeb 4, 2022
Update check on debug config generation fail
When sketch debugging is initiated, the extension runs Arduino CLI to get the debugger configuration information. This information is required to generate the `launch.json` configuration file. As part of this information is the path to the compiled sketch binary, Arduino CLI checks for the existence of that file, and errors if it is not present (which is usually caused by the user having neglected to compile the sketch): ``` Error getting Debug info: Compiled sketch not found in ... ``` The extension has special handling for this specific common error cause, which is based on a fragile string comparison on the human readable error message. As is the nature of this approach, a seemingly innocuous capitalization change to the message in the Arduino CLI code base broke the check. The quick fix provided here is making the check case insensitive.
1 parent 5382501 commit cc16f9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ async function startDebug(_: ExtensionContext, config: DebugConfig): Promise<boo
114114
}
115115
if (!rawStdout) {
116116
if (rawStdErr) {
117-
if (rawStdErr.indexOf('compiled sketch not found in') !== -1) {
117+
if (rawStdErr.toLowerCase().indexOf('compiled sketch not found in') !== -1) {
118118
vscode.window.showErrorMessage(`Sketch '${path.basename(config.sketchPath)}' was not compiled. Please compile the sketch and start debugging again.`);
119119
} else {
120120
vscode.window.showErrorMessage(rawStdErr);

0 commit comments

Comments
 (0)
Please sign in to comment.