[other] better error message for IndexError for empty containers (#11476)
This commit is contained in:
parent
639e9a7aa9
commit
b3d2cd738a
1 changed files with 2 additions and 1 deletions
|
|
@ -4,7 +4,8 @@ template formatErrorIndexBound*[T](i, a, b: T): string =
|
|||
when defined(standalone):
|
||||
"indexOutOfBounds"
|
||||
else:
|
||||
"index " & $i & " not in " & $a & " .. " & $b
|
||||
if b < a: "index out of bounds, the container is empty"
|
||||
else: "index " & $i & " not in " & $a & " .. " & $b
|
||||
|
||||
template formatErrorIndexBound*[T](i, n: T): string =
|
||||
formatErrorIndexBound(i, 0, n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue