Return plugin error when requesting settings (#86052)
This commit is contained in:
@@ -173,6 +173,11 @@ func (hs *HTTPServer) GetPluginList(c *contextmodel.ReqContext) response.Respons
|
||||
func (hs *HTTPServer) GetPluginSettingByID(c *contextmodel.ReqContext) response.Response {
|
||||
pluginID := web.Params(c.Req)[":pluginId"]
|
||||
|
||||
perr := hs.pluginErrorResolver.PluginError(c.Req.Context(), pluginID)
|
||||
if perr != nil {
|
||||
return response.Error(http.StatusInternalServerError, perr.PublicMessage(), perr)
|
||||
}
|
||||
|
||||
plugin, exists := hs.pluginStore.Plugin(c.Req.Context(), pluginID)
|
||||
if !exists {
|
||||
return response.Error(http.StatusNotFound, "Plugin not found, no installed plugin with that id", nil)
|
||||
|
||||
Reference in New Issue
Block a user