Use repr of the error, or it cant be converted to JSON

Merge:	releng/9.1.0