[tm-bench] nice formatting for error

This commit is contained in:
Anton Kaliaev
2017-03-22 15:53:30 +04:00
parent 31ee29d2f0
commit 14b0589d6b

View File

@ -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++
}