From 14b0589d6b22f5c4e736ca4ae9ad314c8eed640a Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Mar 2017 15:53:30 +0400 Subject: [PATCH] [tm-bench] nice formatting for error --- tm-bench/transacter.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tm-bench/transacter.go b/tm-bench/transacter.go index d35a9e6f0..96a856e6d 100644 --- a/tm-bench/transacter.go +++ b/tm-bench/transacter.go @@ -5,6 +5,7 @@ import ( "encoding/hex" "fmt" "math/rand" + "os" "sync" "time" @@ -47,8 +48,8 @@ func (t *transacter) Start() error { } } + t.wg.Add(t.Connections) for i := 0; i < t.Connections; i++ { - t.wg.Add(1) go t.sendLoop(i) } @@ -84,7 +85,8 @@ func (t *transacter) sendLoop(connIndex int) { Params: []interface{}{hex.EncodeToString(tx)}, }) if err != nil { - panic(errors.Wrap(err, fmt.Sprintf("lost connection to %s", conn.Address))) + fmt.Printf("Lost connection to %s. Please restart the test.\nDetails:\n%v", conn.Address, err) + os.Exit(1) } num++ }