Rename variable
This commit is contained in:
parent
c7bd7aff58
commit
3f4b0b5554
|
@ -121,7 +121,7 @@ func generateAppServiceAccount(
|
|||
// Create an account for the application service
|
||||
_, err := accountsDB.CreateAccount(ctx, as.SenderLocalpart, "", as.ID)
|
||||
if err != nil {
|
||||
if errors.Is(err, internal.ErrSQLUserExists) { // This account already exists
|
||||
if errors.Is(err, internal.ErrUserExists) { // This account already exists
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
|
|
|
@ -164,7 +164,7 @@ func (d *Database) createAccount(
|
|||
}
|
||||
if err := d.profiles.insertProfile(ctx, txn, localpart); err != nil {
|
||||
if internal.IsUniqueConstraintViolationErr(err) {
|
||||
return nil, internal.ErrSQLUserExists
|
||||
return nil, internal.ErrUserExists
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -830,7 +830,7 @@ func completeRegistration(
|
|||
|
||||
acc, err := accountDB.CreateAccount(ctx, username, password, appserviceID)
|
||||
if err != nil {
|
||||
if errors.Is(err, internal.ErrSQLUserExists) { // user already exists
|
||||
if errors.Is(err, internal.ErrUserExists) { // user already exists
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.UserInUse("Desired user ID is already taken."),
|
||||
|
|
|
@ -23,7 +23,7 @@ import (
|
|||
)
|
||||
|
||||
// ErrUserExists is returned if a username already exists in the database.
|
||||
var ErrSQLUserExists = errors.New("Username already exists")
|
||||
var ErrUserExists = errors.New("Username already exists")
|
||||
|
||||
// A Transaction is something that can be committed or rolledback.
|
||||
type Transaction interface {
|
||||
|
|
Loading…
Reference in a new issue