daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. exception handling for servicemodel exceptions
  2. try{  call to service }
  3.   catch(CommunicationObjectFaultedException){}
  4.    catch (EndpointNotFoundException){}
  5.    
  6. public static bool TryExecute(Action a) {
  7.         try {
  8.             a();
  9.             return true;
  10.         }
  11.         catch (CommunicationObjectFaultedException) { }
  12.         catch (EndpointNotFoundException) { }
  13.         return false;
  14.     }
  15.    
  16. bool ok = TryExecute(() => {
  17.             // call to service
  18.             //...
  19.         });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top