From: NeilBrown Date: Thu, 14 Sep 2023 04:04:22 +0000 (+1000) Subject: notmuch master_view: catch exception so .recursed in reset properly. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=c5b6ea925dab0c1721bd94e83954d69e7a16d608;p=edlib.git notmuch master_view: catch exception so .recursed in reset properly. If self.list_pane.call(key, **a) raised an exception, self.recursed would not be reset, and so would cause repeated warnings. So DTRT. Signed-off-by: NeilBrown --- diff --git a/python/module-notmuch.py b/python/module-notmuch.py index 0f7cc11f..f2890f5c 100644 --- a/python/module-notmuch.py +++ b/python/module-notmuch.py @@ -1926,14 +1926,17 @@ class notmuch_master_view(edlib.Pane): def handle_maindoc(self, key, **a): "handle-prefix:doc:notmuch:" # any doc:notmuch calls that haven't been handled - # are handled to the list_pane + # are handed to the list_pane if self.recursed == key: edlib.LOG("doc:notmuch: recursed!", key) + edlib.LOG_BT() return edlib.Efail prev = self.recursed self.recursed = key - # FIXME catch exception to return failure state properly - ret = self.list_pane.call(key, **a) + try: + ret = self.list_pane.call(key, **a) + except edlib.commandfailed: + ret = edlib.Efail self.recursed = prev return ret