Skip to content

Commit

Permalink
[Include Table][Added] Index range validation
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Oct 24, 2024
1 parent 814b423 commit ebe3520
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kibot/pre_include_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,10 @@ def update_table(ops, parent):
logger.debug(f' - {group_suffix} index: {index}')
csv = out_to_csv_mapping.get(group_suffix)
if csv:
# TODO: validate index and document it
if index < 0 or index >= len(csv):
msg = f'index {index+1} is out of range, '+('only one CSV available' if len(csv) == 1 else
f'must be in the [1,{len(csv)}] range')
raise KiPlotConfigurationError(msg)
# We know about it
x1, y1, x2, y2 = GS.compute_group_boundary(g)
item = g.GetItems()[0]
Expand Down

0 comments on commit ebe3520

Please sign in to comment.