Ok, I found out why 2 was happening, it was because I was calling the 
function directly, without checking if any exceptions were throw, I'm using 
node::MakeCallback() now.



Em quarta-feira, 10 de setembro de 2014 16h29min04s UTC-3, Jonathan Cardoso 
escreveu:
>
> Currently I'm building a libcurl <http://curl.haxx.se/libcurl/c/> 
> bindings for nodejs,  mostly for learning purposes, as I'm really new to 
> C++ (like, this is my first time programming something in C++), so you can 
> find it here: https://github.com/JCMais/node-libcurl
>
> If anyone is willing to take a look at the code and give me any advices I 
> would be really grateful.The main class is here: 
> https://github.com/JCMais/node-libcurl/blob/develop/src/Curl.cc
>
> Right now, I have some major doubts:
>
> 1. I should use HandleScope even on code executed by another thread? See 
> this piece of code: 
> https://github.com/JCMais/node-libcurl/blob/develop/src/Curl.cc#L409
>
> If not, how I should throw the exception that is in there and return it?
>
> 2. Why the exception stack trace is lost when I throw an exception from 
> inside a function called by the native module?
>
> Ex: Inside the file examples\simple-request.js, if I replace the end event 
> callback with:
>
> throw Error( 'Something went wrong.' );
>
> it shows the following:
> .\examples\simple-request.js:599: Uncaught Error: Something went wrong.
>
> Line is incorrect, and there is no stack trace. What is going on?
>
> Thanks in advance.
>
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/85ce2ad3-d2de-4b17-9efb-26179ad29d29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to