Exemple #1
0
        private void HandleFailure(SyncEventArgs syncEventArgs)
        {
            lock (_locker) _errorCount += 1;

            NotifySyncEvent(this, syncEventArgs);
            if (_abortThreshold < _errorCount)
            {
                string message = "Sync failures exceeded the threshold. Process aborted. Threshold:" + _abortThreshold;
                Logger.Fatal(message);
                throw new SyncAbortedException(message);
            }
        }
Exemple #2
0
 public void HandleMappingFailure(string objectType, XElement obj, object source, Exception ex)
 {
     Logger.Error(String.Format("Failed to map object: {0}", obj), ex);
     var syncEventArgs = new SyncEventArgs
                             {
                                 Destination = source,
                                 EventType = SyncEventType.Error,
                                 Error = ex,
                                 Data = obj.ToString(),
                                 ObjectType = objectType
                             };
     HandleFailure(syncEventArgs);
 }
Exemple #3
0
 public void HandleSalsaClientException(string objectType, int salsaKey, object destination, Exception ex)
 {
     Logger.Error(String.Format("Got Salsa client error for: {0} with key:{1}", objectType, salsaKey), ex);
     var syncEventArgs = new SyncEventArgs
     {
         Destination = destination,
         EventType = SyncEventType.Error,
         Error = ex,
         SalsaKey = salsaKey,
         ObjectType = objectType
     };
     HandleFailure(syncEventArgs);
 }
Exemple #4
0
 public void HandleSyncObjectFailure(SyncObject obj, object destination, Exception ex)
 {
     Logger.Error(String.Format("Failed to sync object: {0}", obj), ex);
     var syncEventArgs = new SyncEventArgs { SyncObject = obj, Destination = destination, EventType = SyncEventType.Error, Error = ex };
     HandleFailure(syncEventArgs);
 }