From 1dcf6d00e4a98514e376165f74f77f6064dcef87 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Mon, 1 Sep 2008 13:46:36 +0200 Subject: [PATCH] Exit if anything fails --- src/eweouz-dump-addressbook.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/eweouz-dump-addressbook.c b/src/eweouz-dump-addressbook.c index ca07d21..237b2dc 100644 --- a/src/eweouz-dump-addressbook.c +++ b/src/eweouz-dump-addressbook.c @@ -76,12 +76,14 @@ int main(int argc, char **argv) if (error != NULL) { fprintf(stderr, "%s\n", error->message); + return 1; } e_book_get_addressbooks(&source_list, &error); if (error != NULL) { fprintf(stderr, "%s\n", error->message); + return 1; } if (search_filter != NULL) { @@ -99,8 +101,25 @@ int main(int argc, char **argv) for (s = sources ; s; s = s->next) { source = E_SOURCE(s->data); book = e_book_new(source, &error); + + if (error != NULL) { + fprintf(stderr, "%s\n", error->message); + return 1; + } + e_book_open(book, TRUE, &error); + + + if (error != NULL) { + fprintf(stderr, "%s\n", error->message); + return 1; + } + e_book_get_contacts(book, query, &contacts, &error); + if (error != NULL) { + fprintf(stderr, "%s\n", error->message); + return 1; + } for (c = contacts; c; c = c->next) { dump_as_vcard(E_CONTACT(c->data), 1); -- 2.39.5