2011-07-27 4 views
0

에 의해 처리되지 않은이었다WebProtocolException 내 try 블록의 코드가 뭔가 아래 보이는 사용자 코드

catch (ThinkBusinessLogicException ex) 
{ 
    var message = (ex.InnerException != null) ? ex.InnerException.ToString() : ex.Message; 

    if (message == "CustomerID in A does not match customerId in B") 
    { 
     Error = new ErrorStore("400", "1", "CustomerID in A does not match customerId in B"); 
     throw new WebProtocolException(HttpStatusCode.BadRequest, Error.Description, Error.Generate(), null, null); 
    } 

    throw new WebProtocolException(HttpStatusCode.InternalServerError, message, new ErrorStore("500", "1", message).Generate(), null, null); 
} 

무엇 발생하는 조건이 충족되고 상태에서 WebProtolException가 만나 발생된다는 점이다. 그러나 outter를 디버깅하는 동안 WebProtocolException은 "A의 WebProtocolException CustomerID가 B의 customerId와 일치하지 않습니다."라는 내용의 사용자 코드가 처리되지 않았습니다.

그러나 내가 Fiddler를 살펴보면 400이라는 상태 코드가 표시되고 fiddler의 원시 탭에 메시지와 함께 올바른 badrequest 응답이 디스패치됩니다.

두 번째 WebProtocol이 사용자 코드로 처리되지 않는 이유는 혼란 스럽습니다.

모든 의견을 보내 주시면 감사하겠습니다. 이 zal

답변

관련 문제