Better error handling, many fixes all around

This commit is contained in:
2024-12-09 19:53:15 +02:00
parent b52d4f6532
commit 7a36614232
15 changed files with 520 additions and 233 deletions

View File

@@ -78,7 +78,7 @@ func SaveToFile(rootPath string, s *Snapshot, done chan struct{}) {
finalPath, err := calcFilePath(parentPath, urlPath)
if err != nil {
logging.LogError("Error saving %s: %w", s.URL, err)
logging.LogError("GeminiError saving %s: %w", s.URL, err)
return
}
// Ensure the directory exists
@@ -93,7 +93,7 @@ func SaveToFile(rootPath string, s *Snapshot, done chan struct{}) {
err = os.WriteFile(finalPath, []byte((*s).GemText.String), 0o666)
}
if err != nil {
logging.LogError("Error saving %s: %w", s.URL.Full, err)
logging.LogError("GeminiError saving %s: %w", s.URL.Full, err)
}
close(done)
}