It's easy to wrap the `.thread` proc like so:
    
    
    var errorChannel: Channel[string]
    open errorChannel
    
    proc myThreadProc() {.thread.} =
      try:
        stuffThatCanFail()
      except:
        errorChannel.send getCurrentExceptionMsg()
    
    createThread(th, myThreadProc)
    joinThread(th)
    # check for errors: ...
    
    
    Run

It works, no reason to fear exceptions. 

Reply via email to