I have the following code:
try {
> require('./index.js');
> }
> catch(e) {
> console.log('----------------------');
> console.log(e.stack);
> }
When I run the code, the following gets logged to the console:
C:\[path]\index.js:9
> return1 response.send('asdf');
> ^^^^^^^^
> ----------------------
> Unexpected identifier
> SyntaxError: Unexpected identifier
> [Stack trace]
According to the output, the first blurb of text (C:\[path] etc...) is an
internally logged error outside the exception object, since it appears
before the '-------------'.
I've tried everything to catch this error so I can write it to a file or
email it, but it seems completely uncatchable. Is there something I'm
missing?
--
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