예외 처리기에 예외를 추가 할 수 있습니까?이벤트 핸들러에 예외를 추가 할 수 있습니까?
if (customer == null)
{
eventListener.HandleEvent(Severity.Informational, line.GetType().Name, String.Format("Could not find the customer corresponding to the taxId '{0}' Current Employment will not be imported.", new TaxId(line.TaxId).Masked));
return;
}
if (incomeType == null)
{
eventListener.HandleEvent(Severity.Warning, line.GetType().Name, String.Format("The income type of '{0}' in the amount of {1:c} is not a known type.", line.Type, line.Amount));
return;
}
내가 시도 캐치 블록이 문을 넣을 수 있습니다 : 여기
내 코드? 이벤트 처리기에서 처리 한 많은 오류 메시지가 있기 때문에. 따라서 많은 이벤트 핸들러를 작성하는 대신 한 번만 작성하여 처리 할 수 있습니까?
예외를 포착하여 'HandleEvent' 메소드에 전달할 수 있는지 묻는 중입니까? – JeremiahDotNet
'eventListener'의 종류는 무엇입니까? – jdphenix
이 읽는 것이 도움이 될 수 있습니다. http://msdn.microsoft.com/en-us/library/ms173160.aspx –