Skip to content

Commit 181a90d

Browse files
committed
include stop value in error message
1 parent fdbae8e commit 181a90d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/motor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ Motor_run_for_rotations(PyObject *self, PyObject *args, PyObject *kwds)
11931193
decel = CLIP(decel, DECEL_MIN, DECEL_MAX);
11941194
if ((parsed_stop = parse_stop(motor, stop)) < 0)
11951195
{
1196-
PyErr_SetString(PyExc_ValueError, "Invalid stop state");
1196+
PyErr_Format(PyExc_ValueError, "Invalid stop state: %d", stop);
11971197
return NULL;
11981198
}
11991199

src/pair.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,9 +938,10 @@ MotorPair_run_for_rotations(PyObject *self, PyObject *args, PyObject *kwds)
938938
power = CLIP(power, POWER_MIN, POWER_MAX);
939939
accel = CLIP(accel, ACCEL_MIN, ACCEL_MAX);
940940
decel = CLIP(decel, DECEL_MIN, DECEL_MAX);
941+
941942
if ((parsed_stop = parse_stop(stop)) < 0)
942943
{
943-
PyErr_SetString(PyExc_ValueError, "Invalid stop state");
944+
PyErr_Format(PyExc_ValueError, "Invalid stop state: %d", stop);
944945
return NULL;
945946
}
946947

0 commit comments

Comments
 (0)