mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
prevent error storm when browser table encounters panic
This commit is contained in:
parent
a53c130177
commit
6e992752ca
1 changed files with 9 additions and 0 deletions
|
@ -75,6 +75,15 @@ class DataModel(QAbstractTableModel):
|
||||||
return CellRow.deleted(self.len_columns())
|
return CellRow.deleted(self.len_columns())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return CellRow.generic(self.len_columns(), str(e))
|
return CellRow.generic(self.len_columns(), str(e))
|
||||||
|
except BaseException as e:
|
||||||
|
# fatal error like a panic in the backend - dump it to the
|
||||||
|
# console so it gets picked up by the error handler
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
traceback.print_exc()
|
||||||
|
# and prevent Qt from firing a storm of follow-up errors
|
||||||
|
self._block_updates = True
|
||||||
|
return CellRow.generic(self.len_columns(), "error")
|
||||||
|
|
||||||
gui_hooks.browser_did_fetch_row(
|
gui_hooks.browser_did_fetch_row(
|
||||||
item, self._state.is_notes_mode(), row, self._state.active_columns
|
item, self._state.is_notes_mode(), row, self._state.active_columns
|
||||||
|
|
Loading…
Reference in a new issue