Skip to content

Commit

Permalink
Fixing up error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
msoos committed Oct 3, 2022
1 parent 454aef2 commit e63638a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/src/pyapproxmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ static void setup_counter(Counter *self, PyObject *args, PyObject *kwds)
PyErr_SetString(PyExc_ValueError, "verbosity must be at least 0");
return;
}
if (self->epsilon <= 0) {
PyErr_SetString(PyExc_ValueError, "epsilon must be greater than 0");
if (self->epsilon <= 0 || self->epsilon >= 1) {
PyErr_SetString(PyExc_ValueError, "epsilon must be greater or equal to 0, and less than 1");
return;
}
if (self->delta < 0 || self->delta >= 1) {
PyErr_SetString(PyExc_ValueError, "delta must be greater than or equal to 0 and less than 1");
PyErr_SetString(PyExc_ValueError, "delta must be greater or equal to 0, and less than 1");
return;
}

Expand Down

0 comments on commit e63638a

Please sign in to comment.