mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 21:19:28 -06:00
1528d6f5c4
* Move errors to error file * Move check for both empty username and email to user service * Move check for empty email and username to user service Update * Wrap inner error * Set username in test
25 lines
769 B
Go
25 lines
769 B
Go
package user
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/grafana/grafana/pkg/util/errutil"
|
|
)
|
|
|
|
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 (
|
|
ErrEmptyUsernameAndEmail = errutil.BadRequest(
|
|
"user.empty-username-and-email", errutil.WithPublicMessage("Need to specify either username or email"),
|
|
)
|
|
)
|