Add error handler and let the number of client used in test to be configured externally

Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>