summaryrefslogtreecommitdiff
path: root/alot/buffers
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-05-08 22:27:36 +0200
committerAnton Khirnov <anton@khirnov.net>2020-05-09 15:27:23 +0200
commite2b3f678be5e1a9f07b2ba921d759b1813c65115 (patch)
treea51b371d354ad0dc0e4fa41ffdeb47159d212c13 /alot/buffers
parent9578a7245ff7b705e8531014994025cdc4f1b154 (diff)
buffers/search: do not lose exceptions while constructing list widgets
Diffstat (limited to 'alot/buffers')
-rw-r--r--alot/buffers/search.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/alot/buffers/search.py b/alot/buffers/search.py
index 8c4c4f7c..c5b6bbcd 100644
--- a/alot/buffers/search.py
+++ b/alot/buffers/search.py
@@ -45,7 +45,13 @@ class PipeWalker(urwid.ListWalker):
def __getitem__(self, pos):
self._check_pos(pos)
if not pos in self._wgts:
- self._wgts[pos] = ThreadlineWidget(self._tids[pos], self._dbman)
+ # make sure an exception while constructing the widget does not get
+ # swallowed by urwid
+ try:
+ self._wgts[pos] = ThreadlineWidget(self._tids[pos], self._dbman)
+ except (KeyError, IndexError, TypeError) as e:
+ raise ValueError('Exception while constructing threadline widget') from e
+
return self._wgts[pos]
def _check_pos(self, pos):