Catalog: Show install error with incompatible version (#65059)
This commit is contained in:
@@ -53,6 +53,15 @@ func (e Response4xxError) Error() string {
|
||||
return fmt.Sprintf("%d", e.StatusCode)
|
||||
}
|
||||
|
||||
type ErrArcNotFound struct {
|
||||
PluginID string
|
||||
SystemInfo string
|
||||
}
|
||||
|
||||
func (e ErrArcNotFound) Error() string {
|
||||
return fmt.Sprintf("%s is not compatible with your system architecture: %s", e.PluginID, e.SystemInfo)
|
||||
}
|
||||
|
||||
type ErrVersionUnsupported struct {
|
||||
PluginID string
|
||||
RequestedVersion string
|
||||
|
||||
@@ -115,10 +115,9 @@ func (m *Manager) selectVersion(plugin *Plugin, version string, compatOpts Compa
|
||||
var ver Version
|
||||
latestForArch := latestSupportedVersion(plugin, compatOpts)
|
||||
if latestForArch == nil {
|
||||
return nil, ErrVersionUnsupported{
|
||||
PluginID: plugin.ID,
|
||||
RequestedVersion: version,
|
||||
SystemInfo: compatOpts.String(),
|
||||
return nil, ErrArcNotFound{
|
||||
PluginID: plugin.ID,
|
||||
SystemInfo: compatOpts.OSAndArch(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user