Generally you just set functions and other properties on the provided "target" object (which end up being the native module's exports). Throwing from within an the initialization function, it'd say, is undefined behavior.
However, it may be possible to catch those errors and act appropriately, but I haven't checked that code yet to verify. On Sat, Nov 10, 2012 at 4:25 PM, Ryan Cole <[email protected]> wrote: > I'm getting a seg fault core dump in a simple module. I can eliminate the > seg fault if I comment out a ThrowException call in the initialization > function. > > My code: https://gist.github.com/4053133 (line #28) > > Things makes me wonder, what are the acceptable actions to take inside of > this initialize function? Is this seg fault occurring because I'm throwing > an exception while loading the module? Obviously I need to figure out why > the function call on line 27 is failing, so that I can avoid that error > condition all together. How should I handle initialization failures, though? > > Thanks, > Ryan > > -- > 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 -- 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
