aboutsummaryrefslogtreecommitdiffhomepage
path: root/bindings
diff options
context:
space:
mode:
authorGravatar Justus Winter <4winter@informatik.uni-hamburg.de>2012-05-09 12:23:06 +0200
committerGravatar David Bremner <bremner@debian.org>2012-05-11 08:28:06 -0300
commit9f5478637c925ec9996328671d9a8f26ac6a6ed4 (patch)
treeeb2e3364efb3fb51e1ce48d632ed84e1b09afe11 /bindings
parentece52759a5df16fbb588b87f2e61e3575b624514 (diff)
go: update notmuch-addrlookup to the new API
notmuch.OpenDatabase now returns a status indicating success or failure. Use this information to inform the user of any failures. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Diffstat (limited to 'bindings')
-rw-r--r--bindings/go/cmds/notmuch-addrlookup.go8
1 files changed, 6 insertions, 2 deletions
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