>From excpt's source code, it was written with systems without exceptions in 
>mind: Exception handling code. Carefully coded so that tiny programs which do 
>not use the heap (and nor exceptions) do not include the GC or memory 
>allocator.

You can set a custom message however: 
    
    
    errorMessageWriter = proc(m: string) = echo "Custom: ", m
    
    var i = 0
    echo 5 div i
    # Custom: Traceback (most recent call last)
    # main.nim(5)              main
    #system.nim(2534)         sysFatal
    # Error: unhandled exception: division by zero [DivByZeroError]
    

It depends on what you need, you probably prefer to set a [global/local 
exception handler](https://nim-lang.org/docs/system.html#globalRaiseHook): 
    
    
    globalRaiseHook = proc (e: ref Exception): bool =
      echo "AY AY AY!"
      quit(1)
    
    var i = 0
    echo 5 div i
    # AY AY AY!
    # exit status 1
    

Reply via email to