From f91f1f88c43f9180198ee67630b17e13bfeeaa51 Mon Sep 17 00:00:00 2001 From: mpl Date: Tue, 23 Oct 2012 18:28:42 +0200 Subject: [PATCH] camput: final error printing Change-Id: Icc51560545b20315a0383d7bda80170c5612e1f2 --- cmd/camput/camput.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/camput/camput.go b/cmd/camput/camput.go index c09d0cb5c..9cd4307d4 100644 --- a/cmd/camput/camput.go +++ b/cmd/camput/camput.go @@ -253,8 +253,14 @@ func camputMain(args ...string) { log.Printf("Client stats: %s", stats.String()) log.Printf(" #HTTP reqs: %d", up.transport.reqs) } - if err != nil || wereErrors /* TODO: remove this part */ { - log.Printf("Error: %v", err) + previousErrors := wereErrors + if err != nil { + wereErrors = true + if !previousErrors { + log.Printf("Error: %v", err) + } + } + if wereErrors { exit(2) } }