Chore: Handle wrapped errors (#29223)
* Chore: Handle wrapped errors Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
This commit is contained in:
co-authored by
Emil Tullstedt
parent
0cb29d337a
commit
294770f411
@@ -2,13 +2,14 @@ package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
)
|
||||
|
||||
func (hs *HTTPServer) AdminProvisioningReloadDashboards(c *models.ReqContext) Response {
|
||||
err := hs.ProvisioningService.ProvisionDashboards()
|
||||
if err != nil && err != context.Canceled {
|
||||
if err != nil && !errors.Is(err, context.Canceled) {
|
||||
return Error(500, "", err)
|
||||
}
|
||||
return Success("Dashboards config reloaded")
|
||||
|
||||
Reference in New Issue
Block a user