mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
20 lines
266 B
Nim
20 lines
266 B
Nim
discard """
|
|
action: "run"
|
|
output: '''
|
|
caught
|
|
index out of bounds, the container is empty
|
|
'''
|
|
"""
|
|
|
|
proc fun() =
|
|
var z: seq[string]
|
|
discard z[4]
|
|
|
|
proc main()=
|
|
try:
|
|
fun()
|
|
except Exception as e:
|
|
echo "caught"
|
|
echo getCurrentExceptionMsg()
|
|
|
|
main() |