Handle calls to repr() that produce exceptions.