translate StopIteration to a more useful error
This commit is contained in:
+4
-1
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user