format exceptions as strings