From: Tollef Fog Heen Date: Mon, 1 Sep 2008 11:46:36 +0000 (+0200) Subject: Exit if anything fails X-Git-Tag: 0.2^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dcf6d00e4a98514e376165f74f77f6064dcef87;p=eweouz Exit if anything fails --- 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);