check err in user register command

This commit is contained in:
Danny 2018-04-23 10:50:31 +02:00
parent e736573a57
commit f83d6c2193
2 changed files with 7 additions and 3 deletions

View File

@ -10,7 +10,7 @@ func Seed(n int) {
datastore.Seed(n) datastore.Seed(n)
} }
// Archive processes unarchived data (pageviews to aggeegated count tables) // Archive processes unarchived data (pageviews to aggregated count tables)
func Archive() { func Archive() {
count.Archive() count.Archive()
} }

View File

@ -14,7 +14,11 @@ func Register(email string, password string) {
Email: email, Email: email,
Password: string(hash), Password: string(hash),
} }
user.Save(datastore.DB) err := user.Save(datastore.DB)
if err != nil {
log.Printf("Error creating user: %s", err)
} else {
log.Printf("User %s #%d created.\n", email, user.ID)
}
log.Printf("User %s #%d created.\n", email, user.ID)
} }