public string FetchReleaseNotes() { if (releaseNotes != null) { return(releaseNotes); } try { if (config.ReleaseNotesUrl != null) { releaseNotes = Net.Validator.MakeRequest(() => { return(webClient.DownloadString(config.ReleaseNotesUrl)); }); return(releaseNotes); } } catch (System.Exception e) { if (Net.Utils.IsNetworkUnavailableFrom(e)) { Utils.Log("No valid network connection available."); } else { Utils.Warn("Couldn't fetch release notes from {0}; {1}", config.ReleaseNotesUrl, e.ToString()); } } releaseNotes = "No release notes available!"; return(releaseNotes); }
public string FetchReleaseNotes() { if (releaseNotes != null) { return(releaseNotes); } try { if (config.ReleaseNotesUrl != null) { releaseNotes = webClient.DownloadString(config.ReleaseNotesUrl); return(releaseNotes); } } catch (System.Exception e) { Utils.Warn("Couldn't fetch release notes from {0}; {1}", config.ReleaseNotesUrl, e.ToString()); } releaseNotes = "No release notes available!"; return(releaseNotes); }
// Runs on a background thread. private void CheckForUpdates(object state) { try { bool noNetwork = false; string raw = Net.Validator.MakeRequest( () => { return(client.DownloadString(dependencyGraphUrl)); }, (Exception e) => { if (Net.Utils.IsNetworkUnavailableFrom(e)) { noNetwork = true; return; } Utils.Warn("An error occured when trying to fetch the dependency graph; {0}", e.Message); } ); if (noNetwork) { return; } if (String.IsNullOrEmpty(raw)) { Utils.Warn("Dependency graph is empty, skipping update check..."); return; } if (dependencyGraphManager.Manage(raw)) { updateCheckCallback(); } } catch (System.Net.WebException e) { Utils.Warn("Plugin update check error: {0}", e.Message); } }