Improved exception handling for patient export errors