开发者

Passing Exceptions Across Service Boundaries, bad idea?

开发者 https://www.devze.com 2023-03-16 08:56 出处:网络
I have multiple services running as WCF Services and Web Hosts in IIS. If a client calls an operation on a service and the operatino fails, what is the best practice for informing the client of this

I have multiple services running as WCF Services and Web Hosts in IIS.

If a client calls an operation on a service and the operatino fails, what is the best practice for informing the client of this failure?

Should I return an exception to the client? My main concern with doing this is if I pas开发者_Python百科s an exception from a web host, it seems to occasionally crash the Application Pool due to the Rapid Fail settings.

Thanks!


I would catch the exception and pass it inside the Response object that clients wants.

And Client can try to react to it (by checking status and any exception message).

that way any bad requests wouldn't crash your web service

0

精彩评论

暂无评论...
验证码 换一张
取 消