Skip to content

Commit 9075512

Browse files
authored
[skip changelog] Remove spurious argument from error message (#1827)
`github.com/arduino/arduino-cli/i18n.Tr` provides a `fmt.Printf`-style interface, where the first argument may serve as a template filled by subsequent arguments according to its format verbs. This call contains a subsequent argument, but no verb in the format string to use it. This generates some cryptic content in the error message. For example: Error during install: Error downloading tool arduino:[email protected]: no versions available for the current OS%!(EXTRA *cores.ToolRelease=arduino:[email protected]) The tool name is already provided in the correctly configured `Message` field of the error, so there is no need to include it in the `Cause` field as well, so the spurious argument can be removed entirely rather than the alternative fix of adjusting the format string argument. I suspect the spurious argument was simply the result of a copy/paste error.
1 parent c7163b7 commit 9075512

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arduino/cores/packagemanager/download.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (pm *PackageManager) DownloadToolRelease(tool *cores.ToolRelease, config *d
125125
if resource == nil {
126126
return &arduino.FailedDownloadError{
127127
Message: tr("Error downloading tool %s", tool),
128-
Cause: errors.New(tr("no versions available for the current OS", tool))}
128+
Cause: errors.New(tr("no versions available for the current OS"))}
129129
}
130130
if err := resource.Download(pm.DownloadDir, config, tool.String(), progressCB); err != nil {
131131
return &arduino.FailedDownloadError{

0 commit comments

Comments
 (0)