public void ClientRetryableOperation(string serverName, RpcClientOperation rpcOperation) { if (rpcOperation == null) { throw new ArgumentNullException("rpcOperation"); } string serverName2 = HaRpcExceptionWrapperBase <TBaseException, TBaseTransientException> .SanitizeServerName(serverName); int num = 0; int num2 = 0; int num3 = 0; bool flag; do { flag = false; try { rpcOperation(); } catch (RpcException ex) { if (this.ClientShouldRetryOnError(ex, serverName2, ref num, ref num2, ref num3)) { flag = true; } else { this.ClientHandleRpcException(ex, serverName2); } } }while (flag); }
public void ClientRethrowIfFailed(string databaseName, string serverName, RpcErrorExceptionInfo errorInfo) { Exception ex = null; string text = HaRpcExceptionWrapperBase <TBaseException, TBaseTransientException> .SanitizeServerName(serverName); if (errorInfo.IsFailed()) { if (errorInfo.ReconstitutedException != null) { ex = this.ConstructClientExceptionFromServerException(text, errorInfo.ReconstitutedException); } else { if (errorInfo.SerializedException != null && errorInfo.SerializedException.Length > 0) { try { errorInfo.ReconstitutedException = SerializationServices.Deserialize <Exception>(errorInfo.SerializedException); ex = this.ConstructClientExceptionFromServerException(text, errorInfo.ReconstitutedException); goto IL_109; } catch (SerializationException innerException) { ex = this.GetGenericOperationFailedException(errorInfo.ErrorMessage, innerException); ((TBaseException)((object)ex)).OriginatingServer = text; goto IL_109; } catch (TargetInvocationException innerException2) { ex = this.GetGenericOperationFailedException(errorInfo.ErrorMessage, innerException2); ((TBaseException)((object)ex)).OriginatingServer = text; goto IL_109; } } if (!string.IsNullOrEmpty(errorInfo.ErrorMessage)) { ex = this.GetGenericOperationFailedException(errorInfo.ErrorMessage); ((TBaseException)((object)ex)).OriginatingServer = text; } else { ex = this.GetGenericOperationFailedWithEcException(errorInfo.ErrorCode); ((TBaseException)((object)ex)).OriginatingServer = text; } } IL_109: IHaRpcServerBaseException ex2 = ex as IHaRpcServerBaseException; if (ex2 != null && string.IsNullOrEmpty(ex2.DatabaseName) && !string.IsNullOrEmpty(databaseName)) { ((IHaRpcServerBaseExceptionInternal)ex).DatabaseName = databaseName; } } if (ex != null) { throw ex; } }