-
-
Notifications
You must be signed in to change notification settings - Fork 398
The CLI provides different error messages when loading the main sketch file fails #1968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Too bad, this won't work at all. IDE2 cannot rely on parsing the error message as it's different per locale. After setting the
|
Do not try to parse the original `NotFound` error message, but look for a sketch somewhere in the requested path. Signed-off-by: Akos Kitta <[email protected]>
Do not try to parse the original `NotFound` error message, but look for a sketch somewhere in the requested path. Signed-off-by: Akos Kitta <[email protected]>
Do not try to parse the original `NotFound` error message, but look for a sketch somewhere in the requested path. Signed-off-by: Akos Kitta <[email protected]>
Do not try to parse the original `NotFound` error message, but look for a sketch somewhere in the requested path. Signed-off-by: Akos Kitta <[email protected]>
Do not try to parse the original `NotFound` error message, but look for a sketch somewhere in the requested path. Signed-off-by: Akos Kitta <[email protected]>
Do not try to parse the original `NotFound` error message, but look for a sketch somewhere in the requested path. Signed-off-by: Akos Kitta <[email protected]>
The two cases are logically different, at least from the code perspective. In the sketch initializer we look for a file named as the directory with the
So the source problems seem to be the different and might deserve a different error message. @kittaakos wdyt? |
actually, it is explicitly checked for the correct file case arduino-cli/arduino/sketch/sketch.go Lines 192 to 226 in 558130b
Maybe we can "normalize" the error message with BTW as @kittaakos suggested this is fragile because the messages are localized, the real solution is to implement error codes #1762 |
Thank you for explaining this, but I opened the issue from the user's perspective.
I am not sure. As a user, I do know/mind how this is working internally. I want to load two sketches; both of them have an invalid name according to the spec, so I would expect the same error message. The detail/cause of the errors if any can differ.
I agree. Probably, no need to do anything with this issue once #1762 is resolved. |
Describe the problem
IDE2 must gracefully handle invalid sketch (folder) names and open them even if the CLI cannot load the sketch.
Since CLI can't provide error codes (#1762), IDE2 must parse the error message of the CLI and try to detect invalid sketch name problems. (See arduino/arduino-ide#1563)
Unfortunately, the CLI's error message quite often varies. As a consumer of the CLI, I would expect that the error message is the same if the problem is the same.
To reproduce
Expected behavior
No matter the final error message, it's the same if I want to load, compile, etc an invalid sketch. It should no matter if it's
/foo/Foo.ino
or/Bar/xxx.ino
invalid, it's just invalid.Arduino CLI version
Version: 0.28.0 Commit: 06fb190 Date: 2022-10-20T08:42:20Z
Operating system
macOS
Operating system version
12.5.1
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: