Now printing a hint in case of unhandled exceptions if -d is not specified. Closes #196.
h3rald h3rald@h3rald.com
Mon, 18 May 2026 09:25:05 +0200
1 files changed,
12 insertions(+),
0 deletions(-)
jump to
M
minpkg/core/shell.nim
→
minpkg/core/shell.nim
@@ -7,6 +7,7 @@ critbits,
algorithm, streams, terminal, + exitprocs, json, os ]@@ -25,7 +26,16 @@ minline
var SIMPLEREPL* = false +var SUCCESS* = false + +proc showUnhandledExceptionMessage = + if not SUCCESS: + stderr.writeLine "=> Please re-run this program in development mode (specify -d) for debugging information on this error." + +addExitProc(showUnhandledExceptionMessage) + proc interpret*(i: In, s: string): MinValue = + SUCCESS = false i.open(newStringStream(s), i.filename) discard i.parser.getToken() try:@@ -33,6 +43,8 @@ result = i.interpret()
except CatchableError: discard i.close() + finally: + SUCCESS = true proc getCompletions*(ed: LineEditor, i: MinInterpreter): seq[string] = let symbols = toSeq(i.scope.symbols.keys)