Reputation: 21
As we know , when there was no connection between client and server, the Endpoint not found Exception will be created from WCF services ,
I d like to handle this error just one time and uses several times without several try catches for each WCF services please help me
Thanks
Upvotes: 2
Views: 1725
Reputation: 5322
Wrap your server call in an Invoke method and handle the error there:
public void Invoke(Action<T> call)
{
try
{
call();
}
catch(EndpointNotFoundException exception)
{
// handle here
}
}
Upvotes: 1