chore/backend: move dashboard errors to dashboard service (#51593)
* chore/backend: move dashboard errors to dashboard service Dashboard-related models are slowly moving out of the models package and into dashboard services. This commit moves dashboard-related errors; the rest will come in later commits. There are no logical code changes, this is only a structural (package) move. * lint lint lint
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/provisioning"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/store"
|
||||
@@ -495,7 +496,7 @@ func toNamespaceErrorResponse(err error) response.Response {
|
||||
if errors.Is(err, ngmodels.ErrCannotEditNamespace) {
|
||||
return ErrResp(http.StatusForbidden, err, err.Error())
|
||||
}
|
||||
if errors.Is(err, models.ErrDashboardIdentifierNotSet) {
|
||||
if errors.Is(err, dashboards.ErrDashboardIdentifierNotSet) {
|
||||
return ErrResp(http.StatusBadRequest, err, err.Error())
|
||||
}
|
||||
return apierrors.ToFolderErrorResponse(err)
|
||||
|
||||
Reference in New Issue
Block a user