Chore: use errutil for pluginRepo errors (#78647)

* Chore: use errutil for pluginRepo errors

* Update pkg/util/errutil/status.go

* Use errutil helper functions

Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Forgot the log level

* Use entity

---------

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
Gabriel MABILLE
2023-11-30 15:49:27 +01:00
committed by GitHub
co-authored by Marcus Efraimsson
parent d64c2b6f4e
commit ef2c79d22a
9 changed files with 121 additions and 68 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ func (c *Client) downloadFile(tmpFile *os.File, pluginURL, checksum string, comp
return fmt.Errorf("failed to write to %q: %w", tmpFile.Name(), err)
}
if len(checksum) > 0 && checksum != fmt.Sprintf("%x", h.Sum(nil)) {
return ErrChecksumMismatch{archiveURL: pluginURL}
return ErrChecksumMismatch(pluginURL)
}
return nil
}