]> err.no Git - eweouz/commitdiff
Exit if anything fails
authorTollef Fog Heen <tfheen@err.no>
Mon, 1 Sep 2008 11:46:36 +0000 (13:46 +0200)
committerTollef Fog Heen <tfheen@err.no>
Mon, 1 Sep 2008 11:46:36 +0000 (13:46 +0200)
src/eweouz-dump-addressbook.c

index ca07d2170b540f045508807801ce48c4bd16d0d3..237b2dcc26e1f4788b5c9aba143b8ceeb1cf79b0 100644 (file)
@@ -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);