Chore: Differentiate the ErrOrgNotFound error messages (#64131)

* Better org not found error messages
This commit is contained in:
Sofia Papagiannaki
2023-03-06 09:57:46 +02:00
committed by GitHub
parent 1aadafe7d8
commit fde96c91c1
6 changed files with 19 additions and 14 deletions
+2 -1
View File
@@ -7,15 +7,16 @@ import (
"github.com/grafana/grafana/pkg/models/roletype"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/util/errutil"
)
// Typed errors
var (
ErrOrgNotFound = errors.New("organization not found")
ErrOrgNameTaken = errors.New("organization name is taken")
ErrLastOrgAdmin = errors.New("cannot remove last organization admin")
ErrOrgUserNotFound = errors.New("cannot find the organization user")
ErrOrgUserAlreadyAdded = errors.New("user is already added to organization")
ErrOrgNotFound = errutil.NewBase(errutil.StatusNotFound, "org.notFound", errutil.WithPublicMessage("organization not found"))
)
type Org struct {