diff options
author | Hugo Osvaldo Barrera <hugo@whynothugo.nl> | 2024-07-06 19:21:15 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-08-03 20:09:59 +0200 |
commit | a8894a50d94f19ce77646048a0f07a496383b14a (patch) | |
tree | 1c8aad9a99b89728bc861d835d93ff6290445aa7 | |
parent | c56649fe5291b725f14b45550a68cc7d0dc16ff7 (diff) | |
download | aerc-a8894a50d94f19ce77646048a0f07a496383b14a.tar.gz |
notmuch: improve logging for watcher
When an error occurs initialising a watcher, the error shown is
completely unclear (e.g.: "no such file or directory").
Clarify the error so that its source is clear and log the path
that was used.
Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r-- | worker/notmuch/worker.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go index 2a11c1df..bedc83c6 100644 --- a/worker/notmuch/worker.go +++ b/worker/notmuch/worker.go @@ -266,8 +266,9 @@ func (w *worker) handleConnect(msg *types.Connect) error { // changes, so catching multiple is ok dbPath := path.Join(w.db.Path(), ".notmuch", "xapian") err := w.watcher.Configure(dbPath) + log.Tracef("Configuring watcher for path: %v", dbPath) if err != nil { - return err + return fmt.Errorf("error configuring watcher: %w", err) } return nil } |