[gnome-contacts] Fix some unhandled exception warnings
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Fix some unhandled exception warnings
- Date: Fri, 1 Jul 2011 12:44:12 +0000 (UTC)
commit aff67f956475b4210501445cd57f04ca9aa79cae
Author: Alexander Larsson <alexl redhat com>
Date: Fri Jul 1 11:10:54 2011 +0200
Fix some unhandled exception warnings
src/contacts-contact-pane.vala | 14 +++++++++-----
src/contacts-list-pane.vala | 8 ++++++--
2 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index 9f2917c..e8e2b49 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -630,11 +630,15 @@ public class Contacts.ContactPane : EventBox {
if (modified) {
if (persona == null) {
selected_contact.ensure_writable_persona.begin ( (obj, result) => {
- var p = selected_contact.ensure_writable_persona.end (result);
- if (p is NoteDetails)
- (p as NoteDetails).notes = notes;
- else
- warning ("Writable store doesn't support notes");
+ try {
+ var p = selected_contact.ensure_writable_persona.end (result);
+ if (p is NoteDetails)
+ (p as NoteDetails).notes = notes;
+ else
+ warning ("Writable store doesn't support notes");
+ } catch (Error e) {
+ warning ("Unable to create writable persona: %s", e.message);
+ }
});
} else {
(persona as NoteDetails).notes = notes;
diff --git a/src/contacts-list-pane.vala b/src/contacts-list-pane.vala
index 2c28bc1..f6f4227 100644
--- a/src/contacts-list-pane.vala
+++ b/src/contacts-list-pane.vala
@@ -44,8 +44,12 @@ public class Contacts.CellRendererShape : Gtk.CellRenderer {
context.save ();
bool is_symbolic;
context.add_class (Contact.presence_to_class (presence));
- var pixbuf = info.load_symbolic_for_context (context,
- out is_symbolic);
+ Gdk.Pixbuf? pixbuf = null;
+ try {
+ pixbuf = info.load_symbolic_for_context (context,
+ out is_symbolic);
+ } catch (Error e) {
+ }
context.restore ();
if (!is_symbolic)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]