When you get the first time the stack trace of an error doing `error.stack`, the function `Error.prepareStackTrace` is called (if set). In subsequent calls to `error.stack` the function is not called, so I understand that the result of the previous execution is resused and returned.
My objective is to capture the stack as string and the stack as an array of callsites. I can only execute one time `error.stack` to build the stack, but I need to build it 2 times. Is there any trick to reset the stack in order to rebuild it again? I'm not interested in stringify the callsites by myself, I want to execute the default stringify function, that's why I need to reset the stack, because this default stringify function cannot be accessed from outside (`Error.prepareStackTrace` by default is undefined). -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: 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 post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- 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]. For more options, visit https://groups.google.com/groups/opt_out.
