As I have showed on the code, I do in fact already check if an error occurs. I 
have tried to purposely throw an exception with also the `nimTestErrorFlag`, 
but still nothing really changes.
    
    
    proc onConnect(req: ptr uv_connect_t; status: cint) {.cdecl.} =
        let fut = cast[Future[TCPConnection]](req.data)
        let ctx = cast[TCPConnection](req.handle.data)
        if status != 0:
            fut.fail(returnException(status))
            return
        let err = uv_read_start(req.handle, allocBuffer, readCb)
        if err != 0:
            fut.fail(returnException(err))
            return
        raise newException(Exception, "Could not read")
        {.emit: "nimTestErrorFlag();".}
    
    
    Run

Reply via email to