-
-
Notifications
You must be signed in to change notification settings - Fork 398
As a gRPC consumer of the CLI, I need better error codes to distinguish between errors #1762
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
Besides the application-level error handling for the services, I would like to get a proper exit code and a terminating daemon process when something went wrong. Now, IDE2 must sniff into the stderr of the process, parse such messages and kill the daemon process because it's not terminating, although the daemon is nonfunctional:
Please help IDE2, terminate the daemon process on unrecoverable errors, such as inaccessible data dir or port issues, and provide an exit code. IDE2 wants to help users understand what went wrong, but it's hard because IDE2 is also just guessing the error. Thanks! |
And it's not even creating any config dir, the |
This requires some more brainstorming with @cmaglie |
For now we will fix only this error. If there is a need to fix other errors, this is the moment to speak. We will follow the same pattern used already another error ("upload require programmer error"), we should use the same methodology. |
IDE2 wants to avoid parsing error messages from the CLI as it's unreliable. |
I am going to reopen this issue as a generic go-to ticket until the CLI can provide error codes for at least the following issues:
|
There are open questions on the initial changes at #2076 (comment). |
Probably should not be necessary anymore after #2119 |
It's an essential feature. Please see: #1762 (comment)
|
Please add a specific error code when the programmer is missing from |
It's just partially done. See #1762 (comment). |
Describe the request
To keep the startup performance OK, the IDE2 does not run a core and library index update before initializing the gRPC client. The Arduino core client initialization in the IDE2 happens the following way:
However, this does not always work. The command line CLI auto-magically updates the core and lib indexes on the first run (#1043). This is not available when consuming the CLI's capabilities via the gRPC APIs.
On the first start (
directories/data
is missing or empty), the gRPC init step will fail with the following errors:When the IDE2 sees these errors, IDE2 knows that this is the first start, and the core and lib indexes must be updated before running the init phase of the gRCP core client. The above error is recoverable in IDE2.
There are "ignorable" errors. For example, if I use the
https://arduino.esp8266.com/stable/package_esp8266com_index.json
3rd party URL, and install the3.0.0
version (see the steps here), then there will be an error status:This error does not cause any CLI error, so should be ignored.
Describe the current behavior
All errors the IDE2 receives from the CLI have
code: 9
. There is no way to detect if the error is recoverable, non-recoverable, or ignorable.It would be great if some details about the error would be available.
Arduino CLI version
0.23.0
Operating system
macOS
Operating system version
12.3.1
Additional context
Related
connectex: A connection attempt failed because the remote host did not respond ...
" arduino-ide#2546Keywords
"error protocol"
Issue checklist
The text was updated successfully, but these errors were encountered: