Convert exceptions to unicode using to_unicode rather than str. that stops unicode errors if the string has non-ascii text