mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-12 07:37:34 +00:00
more log.Error -> fmt.Errorf cleanup
This commit is contained in:

committed by
Juan Font

parent
1704977e76
commit
60f0cf908c
@@ -2,10 +2,10 @@ package db
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/juanfont/headscale/hscontrol/types"
|
||||
"github.com/juanfont/headscale/hscontrol/util"
|
||||
"github.com/rs/zerolog/log"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -34,12 +34,7 @@ func CreateUser(tx *gorm.DB, name string) (*types.User, error) {
|
||||
}
|
||||
user.Name = name
|
||||
if err := tx.Create(&user).Error; err != nil {
|
||||
log.Error().
|
||||
Str("func", "CreateUser").
|
||||
Err(err).
|
||||
Msg("Could not create row")
|
||||
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("creating user: %w", err)
|
||||
}
|
||||
|
||||
return &user, nil
|
||||
|
Reference in New Issue
Block a user