timothymcgrath
timothymcgrath

Reputation: 1348

Passing Exceptions Across Service Boundaries, bad idea?

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 pass an exception from a web host, it seems to occasionally crash the Application Pool due to the Rapid Fail settings.

Thanks!

Upvotes: 3

Views: 131

Answers (1)

Bek Raupov
Bek Raupov

Reputation: 3777

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

Upvotes: 2

Related Questions