0

I've got a ProvideFault() service that communicates through wcf. For most exceptions, we want to catch them, convert them into a FaultException<CustomException>, and let the caller handler it, so we've implemented ProvideFault().

So far, so good, and it mostly works. But this service is calling another service, which sometimes throws a TimeoutExeption; we don't want to catch that exception, but instead let it bubble up to the caller (or even throw a new TimeoutException, if necessary). The problem is that when the method throws a TimeoutException, ProvideFault() tries to deal with it and turn it into a FaultException.

How do I force wcf to let it bubble up as a TimeoutException?

4

1 に答える 1

1

WCF は例外を FaultExceptions として送信するため、タイムアウト例外をバブルアップすることはできません。

ただし、できることは次のものを送信することです。

FaultException<TimeoutException>
于 2012-02-02T18:22:11.883 に答える