summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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):