문제

Windows Workflow Foundation에서 사용자 정의 오류 메시지를 ThrowActivity에 던질 수 있습니까?

예를 들어. 내 wf 에서이 예외를 던지고 싶다고 상상해보십시오.

CutomException("This is my custom error message", myNumber, myObect);

건배 :)

도움이 되었습니까?

해결책

어쩌면 나는 당신의 질문을 잘 이해하지 못하지만 당신은 특정 예외를 Fault 의 자산 ThrowActivity 활동 실행 전 어느 곳에서나 : 예를 들어 :

throwActivity1.Fault = new CustomException("This is my custom error message", myNumber, myObect);

다른 팁

이런 식으로 맞춤 예외를 던질 수 있습니다.

public dispontinuedproductexception disontinuedProductexception1 = 새로운 disontinuedProductexception ();

SerializableAttribute ()] 공개 클래스 DiscontInuedProductexception : 예외 {public disontinuedProductexception () : base () {}

    public DiscontinuedProductException(string message)
        : base(message)
    {
    }

    public DiscontinuedProductException(string message, Exception innerException)
        : base(message, innerException)
    {
    }

    protected DiscontinuedProductException(SerializationInfo info, StreamingContext context)
        : base(info, context)
    {
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top