Exceptions
+8 · 1 file changed
-
raisingExceptions.nim+8 −0
@@ -0,0 +1,8 @@ +import strformat +type + MyError = object of Exception + +try: + raise newException(MyError, "details about what went wrong") +except MyError: + echo fmt"[Error] {getCurrentException().name}: {getCurrentException().msg}" \ No newline at end of file