From cdae96263bdf086df6edfcc1d73829348672ca69 Mon Sep 17 00:00:00 2001 From: Sekulum Forka Date: Thu, 13 May 2021 11:19:39 +0200 Subject: [PATCH] Exceptions: Make better exception types --- src/fsh.nim | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/fsh.nim b/src/fsh.nim index 10da1b1..ac2f5f1 100644 --- a/src/fsh.nim +++ b/src/fsh.nim @@ -25,6 +25,17 @@ let builtins: array[4, string] = [ "exit", ] +# Exception types +type + ShellError= object of CatchableError + line: int + col: int + whileExec: string + ShellVariableError=object of ShellError + variable: string + ShellCommandError = object of ShellError + command: string + # forward declarations proc eval(cmd: string): string proc substitute(strm: Stream, delim = ";\p"): string