mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
return the gorm error in case user was not found
This commit is contained in:
parent
768a108627
commit
46e84fc758
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ func (u *User) ByUsername(username string) error {
|
||||||
db := common.GetDB()
|
db := common.GetDB()
|
||||||
err := db.Find(u, "Username = ?", username).Error
|
err := db.Find(u, "Username = ?", username).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("User with username=%v does not exist", username)
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue