[v9.5.x] Catalog: Show install error with incompatible version (#66817)

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

(cherry picked from commit 98778289cb)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2023-04-19 10:51:07 +02:00
committed by GitHub
co-authored by Andres Martinez Gotor
parent 33ff08215c
commit 0315b911ef
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)
}