Use repr for exception printing

Improves error message.