Enhance the exception handler for System.IO