intel
intel copied to clipboard
Crash while trying to write out reason for uncaughtException
I noticed this in a logfile. I don't have steps to reproduce, but it did happen. I guess you need to check that e.stack at least exists, and if not then maybe just dump String(e)
or something.
/data/fxa-auth-server/node_modules/mozlog/node_modules/intel/lib/record.js:24
return e.stack.substr(e.stack.indexOf('\n'));
^
TypeError: Cannot call method 'indexOf' of undefined
at Object.toString (/data/fxa-auth-server/node_modules/mozlog/node_modules/intel/lib/record.js:24:37)
at String (<anonymous>)
at HekaFormatter.hekaFormat [as format] (/data/fxa-auth-server/node_modules/mozlog/lib/format.js:94:24)
at StreamHandler.format (/data/fxa-auth-server/node_modules/mozlog/node_modules/intel/lib/handlers/handler.js:52:28)
at StreamHandler.streamEmit [as _emit] (/data/fxa-auth-server/node_modules/mozlog/node_modules/intel/lib/handlers/stream.js:21:27)
at StreamHandler.emit (/data/fxa-auth-server/node_modules/mozlog/node_modules/intel/lib/handlers/handler.js:13:15)
at Logger.handle (/data/fxa-auth-server/node_modules/mozlog/node_modules/intel/lib/logger.js:218:29)
at Logger._log (/data/fxa-auth-server/node_modules/mozlog/node_modules/intel/lib/logger.js:249:20)
at Logger.critical (/data/fxa-auth-server/node_modules/mozlog/node_modules/intel/lib/logger.js:81:19)
at Logger.catchException (/data/fxa-auth-server/node_modules/mozlog/node_modules/intel/lib/logger.js:192:10)
at process.emit (events.js:95:17)
at process._fatalException (node.js:301:26)
Ah, ok. I worked out how to duplicate this in fxa stage. If the auth_db server is not up, then auth_server and email bouncer when they start get an error with no stack EndpointError: 127.0.0.1:8001 error: connect ECONNREFUSED
.
Don't know why it has no stack, but it doesn't.
/me grumbles something about throwing String
s