ENH: Add better exception catching and reporting.