Chore: Add errutils helpers (#73577)

Add helpers for the errutil package in favor of errutil.NewBase.
This commit is contained in:
Marcus Efraimsson
2023-08-22 12:52:24 +02:00
committed by GitHub
parent 1cc226e689
commit 040b7d2571
45 changed files with 261 additions and 161 deletions

View File

@@ -16,8 +16,8 @@ var (
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"))
ErrCannotChangeRoleForExternallySyncedUser = errutil.NewBase(errutil.StatusForbidden, "org.externallySynced", errutil.WithPublicMessage("cannot change role for externally synced user"))
ErrOrgNotFound = errutil.NotFound("org.notFound", errutil.WithPublicMessage("organization not found"))
ErrCannotChangeRoleForExternallySyncedUser = errutil.Forbidden("org.externallySynced", errutil.WithPublicMessage("cannot change role for externally synced user"))
)
type Org struct {