X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=bindings%2Fgo%2Fcmds%2Fnotmuch-addrlookup.go;h=03699fb488672d8b2e4091f17b6a814fd0d5726b;hb=f83a5c6241db308393d9295aedbcfbeff43a53fd;hp=16958e502e4e1979ef962908729d7ae222f23cf0;hpb=62725a5b59625c164512465af5b3912396b61e8b;p=obsolete%2Fnotmuch-old diff --git a/bindings/go/cmds/notmuch-addrlookup.go b/bindings/go/cmds/notmuch-addrlookup.go index 16958e50..03699fb4 100644 --- a/bindings/go/cmds/notmuch-addrlookup.go +++ b/bindings/go/cmds/notmuch-addrlookup.go @@ -209,8 +209,12 @@ func (self *address_matcher) run(name string) { queries := [3]*notmuch.Query{} // open the database - self.db = notmuch.OpenDatabase(self.user_db_path, - notmuch.DATABASE_MODE_READ_ONLY) + if db, status := notmuch.OpenDatabase(self.user_db_path, + notmuch.DATABASE_MODE_READ_ONLY); status == notmuch.STATUS_SUCCESS { + self.db = db + } else { + log.Fatalf("Failed to open the database: %v\n", status) + } // pass 1: look at all from: addresses with the address book tag query := "tag:" + self.user_addrbook_tag