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

Print error message on certificate flash failure #215

Merged
merged 1 commit into from
Aug 28, 2023
Merged

Print error message on certificate flash failure #215

merged 1 commit into from
Aug 28, 2023

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Aug 25, 2023

Previously, if there was a problem during the flashing stage of the certificate flash command invocation, Arduino Firmware Uploader would exit silently, giving the user no feedback that something had gone wrong other than a generic exit status 1:

$ touch /tmp/cert-with-unsupported-extension.crt

$ arduino-fwuploader certificates flash --address COM42 --file /tmp/cert-with-unsupported-extension.crt --fqbn arduino:renesas_uno:unor4wifi

Converting and flashing certificate C:/Users/per/AppData/Local/Temp/cert-with-unsupported-extension.crt

$ echo $?

1

After the change proposed here, Arduino Firmware Updater clearly communicates to the user that the command failed, and why:

$ arduino-fwuploader certificates flash --address COM42 --file /tmp/cert-with-unsupported-extension.crt --fqbn arduino:renesas_uno:unor4wifi

Converting and flashing certificate C:/Users/per/AppData/Local/Temp/cert-with-unsupported-extension.crt
Error during certificates flashing: cert format .crt not supported, please use .pem or .cer

Previously, if there was a problem during the flashing stage of the certificate flash command invocation, Arduino
Firmware Uploader would exit silently, giving the user no feedback that something had gone wrong other than a generic
exit status 1:

```
$ touch /tmp/cert-with-unsupported-extension.crt

$ arduino-fwuploader certificates flash --address COM42 --file /tmp/cert-with-unsupported-extension.crt --fqbn arduino:renesas_uno:unor4wifi

Converting and flashing certificate C:/Users/per/AppData/Local/Temp/cert-with-unsupported-extension.crt

$ echo $?

1
```
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Aug 25, 2023
@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (45b115d) 12.10% compared to head (9c1e4eb) 12.10%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #215   +/-   ##
=======================================
  Coverage   12.10%   12.10%           
=======================================
  Files          20       20           
  Lines        1165     1165           
=======================================
  Hits          141      141           
  Misses        971      971           
  Partials       53       53           
Flag Coverage Δ
unit 12.10% <0.00%> (ø)

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

Files Changed Coverage Δ
cli/certificates/flash.go 0.00% <0.00%> (ø)

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

Copy link
Contributor

@alessio-perugini alessio-perugini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@per1234 per1234 merged commit f07445f into arduino:main Aug 28, 2023
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants