change error handling

This commit is contained in:
2025-03-16 19:24:56 +09:00
parent 1d6e9258f9
commit f9b6c39353
4 changed files with 15 additions and 11 deletions

View File

@@ -23,7 +23,12 @@ func main() {
for tweet := range tweetchannel {
fmt.Println(tweet)
for _, output := range outputs {
output.Write(tweet)
err := output.Write(tweet)
if err != nil {
errstr := fmt.Sprintf("%s Error: %s", output.GetName(), err)
fmt.Fprintln(os.Stderr, errstr)
d.Write(errstr)
}
}
}
}