change error handling
This commit is contained in:
7
main.go
7
main.go
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user