diff --git a/stand/aggridx.py b/stand/aggridx.py index 0d8270e..f671f41 100644 --- a/stand/aggridx.py +++ b/stand/aggridx.py @@ -10,7 +10,10 @@ class aggridx(ui.aggrid): def row_id_to_index(self, row_id): data = self.options["rowData"] - return next(i for i, d in enumerate(data) if d["run"] == row_id) #TODO: "run" is not generic + try: + return next(i for i, d in enumerate(data) if d["run"] == row_id) #TODO: "run" is not generic + except StopIteration as e: + raise LookupError(f"run {row_id} not found") from e def set_cell_server(self, row_index, col_id, new_val): with self.props.suspend_updates():