2023-10-11 07:27:43 -05:00
|
|
|
package user
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
2024-06-12 23:11:35 -05:00
|
|
|
"github.com/grafana/grafana/pkg/apimachinery/errutil"
|
2023-10-11 07:27:43 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
ErrCaseInsensitive = errors.New("case insensitive conflict")
|
|
|
|
ErrUserNotFound = errors.New("user not found")
|
|
|
|
ErrUserAlreadyExists = errors.New("user already exists")
|
|
|
|
ErrLastGrafanaAdmin = errors.New("cannot remove last grafana admin")
|
|
|
|
ErrProtectedUser = errors.New("cannot adopt protected user")
|
|
|
|
ErrNoUniqueID = errors.New("identifying id not found")
|
|
|
|
ErrLastSeenUpToDate = errors.New("last seen is already up to date")
|
|
|
|
ErrUpdateInvalidID = errors.New("unable to update invalid id")
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2024-03-14 07:25:28 -05:00
|
|
|
ErrEmailConflict = errutil.Conflict("user.email-conflict", errutil.WithPublicMessage("Email is already being used"))
|
2023-10-11 07:27:43 -05:00
|
|
|
ErrEmptyUsernameAndEmail = errutil.BadRequest(
|
|
|
|
"user.empty-username-and-email", errutil.WithPublicMessage("Need to specify either username or email"),
|
|
|
|
)
|
2024-04-17 08:24:36 -05:00
|
|
|
ErrPasswordMissmatch = errutil.BadRequest("user.password-missmatch", errutil.WithPublicMessage("Invalid old password"))
|
2023-10-11 07:27:43 -05:00
|
|
|
)
|