Skip to content

Handling sysFatal gracefully #128

@adigitoleo

Description

@adigitoleo

Unhandled sysFatal from top level scope can crash the repl:

%zsh> inim
👑 INim 0.6.1
Nim Compiler Version 1.6.0 [Linux: amd64] at /usr/bin/nim
nim> var s = newSeq[int](5)
nim> s[5] = 42
fatal.nim(53)            sysFatal
Error: unhandled exception: value out of range: -1 notin 0 .. 9223372036854775807 [RangeDefect]

Other unhandled sysFatal don't show the error message:

%zsh> inim
👑 INim 0.6.1
Nim Compiler Version 1.6.0 [Linux: amd64] at /usr/bin/nim
nim> proc oof() =
....   var s = newSeq[int](5)
....   s[5] = 42
....
nim> oof()
/usr/lib/nim/lib/system/fatal.nim(53) sysFatal

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions