Skip to content

Commit

Permalink
Print error message on certificate flash failure (#215)
Browse files Browse the repository at this point in the history
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  # Create dummy certificate file. Valid certificate is not required for this demo.

$ 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
```
  • Loading branch information
per1234 committed Aug 28, 2023
1 parent 45b115d commit f07445f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/certificates/flash.go
Expand Up @@ -85,7 +85,7 @@ func runFlash(certificateURLs, certificatePaths []string) {
res, flashErr := flashCertificates(uploader, certificateURLs, certificatePaths)
feedback.PrintResult(res)
if flashErr != nil {
os.Exit(int(feedback.ErrGeneric))
feedback.Fatal(fmt.Sprintf("Error during certificates flashing: %s", flashErr), feedback.ErrGeneric)
}
}

Expand Down

0 comments on commit f07445f

Please sign in to comment.