Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Explanation by Sky Sanders makes a lot of sense, and should work for this scenario. Here's a <a href="http://skysanders.net/subtext/archive/2010/04/19/the-proper-use-and-disposal-of-wcf-channels.-or-communicationobjectfaultedexception.aspx" rel="nofollow noreferrer">link to the blog.</a></p> <p>Providing a subscriber to the Faulted event does not do exactly the same thing as calling channel.Abort() inside an exception handler.</p> <p>PriceChanged.Add() is the equivalent of PriceChanged += : you're subscribing a handler to the Price changed event. Placing a try/with block will catch exceptions thrown while subscribing (think custom Add/Remove implementation in your event), and that's not what you want. You're looking for a way to handle exception when calling InputStringData. This thought process naturally leads to <a href="https://stackoverflow.com/questions/6147569/wcf-f-handling-service-shutdown-gracefully-on-client/6157089#6157089">your solution</a>.</p> <p>In C# production code, place a try/catch block around a point where the exception is raised event-side. Catch the exception thrown by subscriber and Debug.Assert with a rethrow, warning developer that all exceptions should be handled subscriber-side. In your code, this means a try/with block that warns and re-throws at evt.Trigger().</p> <p>You could expose the async block instead of running it at the point of declaration. This should provide you with orchestration powers at a higher level: within sendMessage. There's a special API to catch exceptions, handle cancellation and timeouts in one central place that's really worth <a href="https://stackoverflow.com/questions/4431743/map-reduce-with-f-agents/4438256#4438256">looking into</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload