Exemplo n.º 1
0
        public void UpdateManifest(Manifest manifest) {
            if (manifest == null)
                throw new ArgumentNullException("manifest");

            try {
                string manifestPath = GetManifestPath(manifest.Id);
                ModelSerializer.Current.SerializeToFile(manifestPath, manifest);
            } catch (Exception ex) {
                LogAccessor.Log.FormattedError(typeof(FolderQueueStore), ex, "Problem updating manifest '{0}' in folder '{1}'", manifest.Id, _queuePath);
                throw;
            }
        }
        public void UpdateManifest(Manifest manifest) {
            if (manifest == null)
                throw new ArgumentNullException("manifest");

            try {
                string manifestFilename = GetManifestFilename(manifest.Id);
                using (IsolatedStorageDirectory dir = GetStorageDirectory())
                    dir.WriteFile(manifestFilename, manifest);
            } catch (Exception ex) {
                LogAccessor.Log.FormattedError(typeof(IsolatedStorageQueueStore), ex, "Problem updating manifest '{0}' in isolated storage", manifest.Id);
                throw;
            }
        }
        private void SendReport(Manifest manifest) {
            Log.FormattedInfo(typeof(ExceptionlessClient), "Sending Manifest '{0}'", manifest.Id);

            if (manifest.IsSent || !manifest.ShouldRetry()) {
                Log.FormattedInfo(typeof(ExceptionlessClient), "Manifest was not submitted. IsSent: {0}, ShouldRetry: {1}, Attempts: {2}, Last Sent: {3}", manifest.IsSent, manifest.ShouldRetry(), manifest.Attempts, manifest.LastAttempt);
                return;
            }

            manifest.Attempts++;

            SendErrorCompletedEventArgs completed = null;
            Error error = _queue.GetError(manifest.Id);
            if (error == null) {
                manifest.LastError = String.Format("Could not load file '{0}'.", manifest.Id);
                manifest.IsSent = true;
                Log.FormattedInfo(typeof(ExceptionlessClient), manifest.LastError);
            } else
                manifest.IsSent = TrySendError(error, out completed);

            manifest.LastAttempt = DateTime.UtcNow;

            if (manifest.IsSent || completed == null)
                return;

            Log.FormattedError(typeof(ExceptionlessClient), completed.Error, "Problem processing manifest '{0}'.", manifest.Id);
            manifest.LogError(completed.Error);
            manifest.BreakProcessing = (completed.Error is SecurityException);
        }
 private void SendManifest(Manifest manifest) {
     try {
         SendReport(manifest);
     } catch (Exception ex) {
         manifest.LastError = ex.GetAllMessages();
         manifest.LogMessages.Add(String.Concat(DateTime.UtcNow.ToString(), " - ", ex.ToString()));
         Log.FormattedError(typeof(ExceptionlessClient), "Problem sending report {0}: {1}", manifest.Id, ex.Message);
     } finally {
         if (manifest.IsComplete() || manifest.ShouldDiscard()) {
             try {
                 _queue.Delete(manifest.Id);
             } catch (Exception) {
                 _queue.UpdateManifest(manifest);
             }
         } else {
             _queue.UpdateManifest(manifest);
         }
     }
 }
Exemplo n.º 5
0
 public void UpdateManifest(Manifest manifest) {
     int index = _data.FindIndex(d => d.Item1.Id == manifest.Id);
     if (index >= 0)
         _data[index] = Tuple.Create(manifest, _data[index].Item2);
 }
Exemplo n.º 6
0
 public void UpdateManifest(Manifest manifest)
 {
     _accessors.Log.FormattedInfo(typeof(QueueManager), "Updating manifest: {0}", manifest.Id);
     Store.UpdateManifest(manifest);
 }
Exemplo n.º 7
0
 public void UpdateManifest(Manifest manifest) {
     _accessors.Log.FormattedInfo(typeof(QueueManager), "Updating manifest: {0}", manifest.Id);
     Store.UpdateManifest(manifest);
 }