Skip to content
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

Added specific exit-code for "missing programmer" kind of errors. #2429

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Nov 15, 2023

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

arduino-cli now returns exit-code 11 (ErrMissingProgrammer) if the programmer is required to perform an upload/debug action and is not specified.

What is the current behavior?

The CLI returns a generic exit code 1 (ErrGeneric)

What is the new behavior?

Does this PR introduce a breaking change, and is titled accordingly?

Other information

Fix #1762

@cmaglie cmaglie added type: enhancement Proposed improvement topic: CLI Related to the command line interface labels Nov 15, 2023
@cmaglie cmaglie added this to the Arduino CLI v0.35.0 milestone Nov 15, 2023
@cmaglie cmaglie self-assigned this Nov 15, 2023
Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: 37 lines in your changes are missing coverage. Please review.

Comparison is base (6c86fa2) 67.27% compared to head (c50355f) 67.26%.
Report is 3 commits behind head on master.

Files Patch % Lines
internal/cli/debug/debug.go 0.00% 10 Missing ⚠️
internal/cli/burnbootloader/burnbootloader.go 0.00% 8 Missing ⚠️
internal/cli/upload/upload.go 0.00% 8 Missing ⚠️
internal/cli/compile/compile.go 25.00% 4 Missing and 2 partials ⚠️
arduino/errors.go 0.00% 2 Missing ⚠️
commands/daemon/debug.go 0.00% 2 Missing ⚠️
arduino/builder/internal/detector/detector.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2429      +/-   ##
==========================================
- Coverage   67.27%   67.26%   -0.02%     
==========================================
  Files         210      210              
  Lines       20523    20555      +32     
==========================================
+ Hits        13807    13826      +19     
- Misses       5578     5591      +13     
  Partials     1138     1138              
Flag Coverage Δ
unit 67.26% <17.77%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmaglie cmaglie merged commit ff4ed3a into arduino:master Nov 16, 2023
101 of 102 checks passed
cmaglie added a commit that referenced this pull request Nov 16, 2023
)

* Added gRPC message errors

* Implemented specific exit-code for "programmer not found" error
@cmaglie cmaglie deleted the programmer_errors branch November 16, 2023 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: CLI Related to the command line interface type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

As a gRPC consumer of the CLI, I need better error codes to distinguish between errors
2 participants