add error handling for reading configuration #1

Merged
arya merged 9 commits from odyseusz/publapi:master into master 2024-11-04 20:20:30 +05:30
Showing only changes of commit 435a9b2ecf - Show all commits

View File

@ -93,7 +93,7 @@ func userdata(username, usersonline, ops string) Userinfo {
} }
viper.SetConfigFile(filename) viper.SetConfigFile(filename)
if err := viper.ReadInConfig(); err != nil { if err := viper.ReadInConfig(); err != nil {
log.Error("Couldn't read a users meta-info.toml file.", err, username) log.Error("message", "Couldn't read a users meta-info.toml file.", "error", err, "user", username)
user := Userinfo{ user := Userinfo{
Name: username, Name: username,
} }