Print errors in example.

This commit is contained in:
Ryan Bourgeois
2013-11-30 19:21:29 -08:00
parent 92ae83fea4
commit 9dfcc080fc
+5 -1
View File
@@ -35,7 +35,11 @@ loop:
for { for {
select { select {
case event := <-events: case event := <-events:
fmt.Printf("service is %s\n", event.State) if event.Error == nil {
fmt.Printf("service is %s\n", event.State)
} else {
fmt.Printf("service is %s: %s\n", event.State, event.Error)
}
case response := <-responses: case response := <-responses:
if response.Success() { if response.Success() {
fmt.Printf("command %s succeeded\n", response.Name) fmt.Printf("command %s succeeded\n", response.Name)