Revise error messages

This commit is contained in:
Ryan Smith
2024-12-27 22:04:13 -08:00
parent 849709ae01
commit 6f4d1d9921
2 changed files with 3 additions and 3 deletions

View File

@@ -57,7 +57,7 @@ func main() {
if len(*configPath) > 0 {
cfgFromFile, err := config.Load(*configPath)
if err != nil {
log.Fatalln("Failed to load config:", err)
log.Fatalln("Shutting down. Failed to load configuration file:", err)
}
cfg = *cfgFromFile
} else {
@@ -74,7 +74,7 @@ func main() {
// Initialize structured loggers for each honeypot server.
err := cfg.InitializeLoggers()
if err != nil {
log.Fatal("Shutting down. Error: ", err)
log.Fatalln("Shutting down. Failed to initialize logging:", err)
}
defer cfg.CloseLogFiles()

View File

@@ -156,7 +156,7 @@ func Load(filename string) (*Config, error) {
xmlBytes, _ := io.ReadAll(file)
err = xml.Unmarshal(xmlBytes, &config)
if err != nil {
return nil, fmt.Errorf("failed to decode XML file: %w", err)
return nil, err
}
for i := range config.Servers {