[tomboy] Fix crash in autosync when sync server can't be created
- From: Sanford Armstrong <sharm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tomboy] Fix crash in autosync when sync server can't be created
- Date: Mon, 7 Jun 2010 10:21:10 +0000 (UTC)
commit fa76f27e251177c3bb0d14b3fd2c1527e45d2ec3
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date: Mon Jun 7 03:20:54 2010 -0700
Fix crash in autosync when sync server can't be created
https://bugzilla.gnome.org/show_bug.cgi?id=620812
Tomboy/Synchronization/SyncManager.cs | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/Tomboy/Synchronization/SyncManager.cs b/Tomboy/Synchronization/SyncManager.cs
index 45166fd..0f6d1cc 100644
--- a/Tomboy/Synchronization/SyncManager.cs
+++ b/Tomboy/Synchronization/SyncManager.cs
@@ -292,7 +292,17 @@ namespace Tomboy.Sync
var addin = GetConfiguredSyncService ();
if (addin != null) {
// TODO: block sync while checking
- var server = addin.CreateSyncServer ();
+ SyncServer server = null;
+ try {
+ server = addin.CreateSyncServer ();
+ if (server == null)
+ throw new Exception ("addin.CreateSyncServer () returned null");
+ } catch (Exception e) {
+ Logger.Debug ("BackgroundSyncChecker: Exception while creating SyncServer: {0}\n{1}", e.Message, e.StackTrace);
+ addin.PostSyncCleanup ();// TODO: Needed?
+ return;
+ // TODO: Figure out a clever way to get the specific error up to the GUI
+ }
bool serverHasUpdates = false;
bool clientHasUpdates = client.DeletedNoteTitles.Count > 0;
if (!clientHasUpdates) {
@@ -313,6 +323,7 @@ namespace Tomboy.Sync
} catch {
// TODO: A libnotify bubble might be nice
Logger.Debug ("BackgroundSyncChecker: Error connecting to server");
+ addin.PostSyncCleanup ();
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]