mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
config: Improve logging of errors
Currently, the config package logs errors itself, in addition to returning them. That is confusing and results in some duplication of logging. This patch makes config just return errors, and adjusts the callers to log them properly.
This commit is contained in:
@@ -206,7 +206,7 @@ func userRemove() {
|
||||
func aliasesResolve() {
|
||||
conf, err := config.Load(configDir + "/chasquid.conf")
|
||||
if err != nil {
|
||||
Fatalf("Error reading config")
|
||||
Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
_ = os.Chdir(configDir)
|
||||
|
||||
@@ -250,7 +250,7 @@ func aliasesResolve() {
|
||||
func printConfig() {
|
||||
conf, err := config.Load(configDir + "/chasquid.conf")
|
||||
if err != nil {
|
||||
Fatalf("Error reading config")
|
||||
Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
|
||||
fmt.Println(prototext.Format(conf))
|
||||
@@ -262,7 +262,7 @@ func domaininfoRemove() {
|
||||
|
||||
conf, err := config.Load(configDir + "/chasquid.conf")
|
||||
if err != nil {
|
||||
Fatalf("Error reading config")
|
||||
Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
|
||||
// File for the corresponding domain.
|
||||
@@ -292,7 +292,7 @@ func aliasesAdd() {
|
||||
|
||||
conf, err := config.Load(configDir + "/chasquid.conf")
|
||||
if err != nil {
|
||||
Fatalf("Error reading config")
|
||||
Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
_ = os.Chdir(configDir)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user