added optional pretty printing of errors
new client prints errors prettier and exits with non-zero when there are errors