Catalog: Show install error with incompatible version (#65059)

This commit is contained in:
Andres Martinez Gotor
2023-04-19 10:22:24 +02:00
committed by GitHub
parent bc5881a051
commit 98778289cb
8 changed files with 54 additions and 13 deletions
+4
View File
@@ -469,6 +469,10 @@ func (hs *HTTPServer) InstallPlugin(c *contextmodel.ReqContext) response.Respons
if errors.Is(err, plugins.ErrInstallCorePlugin) {
return response.Error(http.StatusForbidden, "Cannot install or change a Core plugin", err)
}
var archError repo.ErrArcNotFound
if errors.As(err, &archError) {
return response.Error(http.StatusNotFound, archError.Error(), nil)
}
return response.Error(http.StatusInternalServerError, "Failed to install plugin", err)
}