provide error information for two more cases
This commit is contained in:
@ -807,13 +807,13 @@ void utils::bounds(const char *file, int line, const std::string &str,
|
||||
if (error) {
|
||||
if ((nlo <= 0) || (nhi <= 0))
|
||||
error->all(file, line, failed, "Invalid range string: {}", str);
|
||||
|
||||
constexpr char fmt[] = "Numeric index {} is out of bounds ({}-{}){}";
|
||||
if (nlo < nmin)
|
||||
error->all(file, line, failed, "Numeric index {} is out of bounds ({}-{})", nlo, nmin, nmax);
|
||||
error->all(file, line, failed, fmt, nlo, nmin, nmax, errorurl(19));
|
||||
else if (nhi > nmax)
|
||||
error->all(file, line, failed, "Numeric index {} is out of bounds ({}-{})", nhi, nmin, nmax);
|
||||
error->all(file, line, failed, fmt, nhi, nmin, nmax, errorurl(19));
|
||||
else if (nlo > nhi)
|
||||
error->all(file, line, failed, "Numeric index {} is out of bounds ({}-{})", nlo, nmin, nhi);
|
||||
error->all(file, line, failed, fmt, nlo, nmin, nhi, errorurl(19));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user