private void HandleError(IDataSynchronizationStatus status, WebException e) { if (status.FailOnError) { throw e; } if (e.Response != null) { using (var response = e.Response.GetResponseStream()) { if (response != null) { using (var sr = new StreamReader(response)) { string result = sr.ReadToEnd(); if (!string.IsNullOrEmpty(result)) { status.LogMessage(string.Concat(e.Message, Environment.NewLine, result)); } } } } } else { if (!status.FailOnError) { status.LogMessage(e.Message); } } }
private static void HandleError(IDataSynchronizationStatus status, Exception e) { if (!status.FailOnError) { status.LogMessage(e.Message); } if (status.FailOnError) { throw e; } }