Skip to content

Commit

Permalink
Improve LED config parsing error messages (qmk#19007)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored and elpekenin committed Dec 7, 2022
1 parent 8229ac8 commit 732c8d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/python/qmk/c_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ def _validate_led_config(matrix, matrix_rows, matrix_indexes, position, position
if len(matrix) != matrix_rows and len(matrix) != (matrix_rows / 2):
raise ValueError("Unable to parse g_led_config matrix data")
if len(position) != len(flags):
raise ValueError("Unable to parse g_led_config position data")
raise ValueError(f"Number of g_led_config physical positions ({len(position)}) does not match number of flags ({len(flags)})")
if len(matrix_indexes) and (max(matrix_indexes) >= len(flags)):
raise ValueError("OOB within g_led_config matrix data")
raise ValueError(f"LED index {max(matrix_indexes)} is OOB in g_led_config - should be < {len(flags)}")
if not all(isinstance(n, int) for n in matrix_indexes):
raise ValueError("matrix indexes are not all ints")
if (len(position_raw) % 2) != 0:
Expand Down

0 comments on commit 732c8d5

Please sign in to comment.