2010-06-18 2 views
3

저는 .NET Exception Management Application Block (EMAB).IExceptionPublisher가 예외를 throw하면 어떻게됩니까?

의 일부로 IExceptionPublisher 클래스를 구현하고 있습니다.

그러나 게시자가 예외를 발견하면 어떻게 될지 궁금합니다.

나는 모습의 약간 주위 apparently 그들이 같은 것을 할 의미했다 :

try 
{ 
    /* Normal Exception Publishing */ 
} 
catch 
{ 
    ExceptionManager.PublishInternalException(exception, additionalInfo); 
} 

Source을 :

한 가지주의 : 예외가있을 경우 어떤 일이 발생 우리의 사용자 지정 게시자 코드, 게시 방지하려면 MSMQ? 이를 위해 ExceptionManager.PublishInternalException 메서드를 사용하여 예외를 기본 게시자 인 인 Windows 응용 프로그램 이벤트 로그에 게시합니다.

그러나, PublishInternalException은 모두 그래서 그것을 액세스 할 ExceptionManager하지 IExceptionPublisher을 구현되어야 할 것이다 내부를 보호합니다.

답변

0

그것은 원래의 예외와 IExceptionPublisher가 응용 프로그램 로그

수동 PublishInternalException가 초기 베타와 관련되어 있어야합니다 호출하는 아이디어를 던졌다 예외를 모두 게시 자체를 처리합니다. 현재 ExceptionManager는 IExceptionPublisher 호출을 PublishInternalException 자체를 호출하는 자체 try-catch로 랩핑합니다. 당신이 반사경의 코드를 체크 아웃 경우 기본적으로이 수행합니다

/* Foreach publisher */ 
Exception originalException; 
try 
{ 
    PublishToCustomPublisher(originalException, additionalInfo, current); 
} 
catch (Exception publisherException) 
{ 
    /* Both of these calls use the DefaultPublisher which is the Application Log */ 
    PublishInternalException(publisherException, null); 
    PublishToDefaultPublisher(originalException, additionalInfo); 
} 

또한 새로운 Enterprise Library Exception Handling Application Block

을 체크 아웃 할 수 있습니다
관련 문제