void importer_OnException(object sender, ExchangeExceptionEventArgs e) { string errText = e.OriginalException.Message; OutlookExchangeExceptionEventArgs args = e as OutlookExchangeExceptionEventArgs; if (args != null) { if (args.OutlookAppointment != null) { errText += String.Format("\r\nEvent '{0}' started on {1:D} at {2}\n", args.OutlookAppointment.Subject, args.OutlookAppointment.Start, args.OutlookAppointment.Start.TimeOfDay); } } AppointmentImporter importer = (AppointmentImporter)sender; importer.Terminate(); e.Handled = true; throw e.OriginalException; }