Catch exceptions in file upload handler.