[tomboy] Correct exception handling when trying to load files without read permissions



commit c9b2876607185380a39b2d93d367152184b3857b
Author: Lukas Vacek <lucas vacek gmail com>
Date:   Fri Jan 14 01:20:35 2011 +0100

    Correct exception handling when trying to load files without read permissions
    
    Signed-off-by: Aaron Borden <adborden live com>

 Tomboy/NoteManager.cs |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/Tomboy/NoteManager.cs b/Tomboy/NoteManager.cs
index 280ff41..33d5ab5 100644
--- a/Tomboy/NoteManager.cs
+++ b/Tomboy/NoteManager.cs
@@ -344,7 +344,20 @@ Ciao!");
 					                     );
 					md.Run();
 					md.Destroy();
-				}
+				} catch (System.UnauthorizedAccessException e) {
+					Logger.Error ("Note {0} can not be loaded - access denied: {1}",
+					            file_path,
+					            e.Message);
+					Gtk.MessageDialog md =
+					  new Gtk.MessageDialog(null,Gtk.DialogFlags.DestroyWithParent,
+					                      Gtk.MessageType.Error,
+					                      Gtk.ButtonsType.Close,
+					                      "Skipping a note.\n {0} can not be loaded - Access denied!",
+					                      file_path
+					                     );
+					md.Run();
+					md.Destroy();
+				}	
 			}
 			
 			notes.Sort (new CompareDates ());



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]