- if (value > std::numeric_limits<uint16_t>::max()) {
- throw std::runtime_error("The value passed to " + parameter + " is too large, the maximum is " + std::to_string(max));
+ if (value > max) {
+ throw std::runtime_error("The value (" + std::to_string(value) + ") passed to " + parameter + " is too large, the maximum is " + std::to_string(max));