90% of the time I always get a stack trace. But sometimes the process just quits and I have no idea why. Anyway to print the stack trace always? Or find more information in dmesg or something?
okay finally found a way to find the error:
node --trace app.js
it outputs every function call and I can see the stacktrace right before it exits with:
startup.processKillAndExit.process.exit
And my stacktrace points to:
redis.get('bar', (err, data) -> JSON.parse(value).foo)
JSON.parse(value)
comes back null
so .foo
throws:
[TypeError: Cannot read property 'foo' of null]
and for some reason the TypeError
inside a redis callback is swallowed and causes node to exit without printing the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With