Browse Source

uncaughtException: no longer exit(1)

to investigate an ongoing issue on Windows, we will logger.critical but temporarily no longer exit on a uncaughtException
master
Gaëtan Renaudeau 7 years ago
parent
commit
c1898402fe
  1. 5
      src/internals/index.js
  2. 8
      src/logger/logger.js

5
src/internals/index.js

@ -16,7 +16,10 @@ process.on('uncaughtException', err => {
type: 'uncaughtException',
error: serializeError(err),
})
process.exit(1)
// FIXME we should ideally do this:
// process.exit(1)
// but for now, until we kill all exceptions:
logger.critical(err, 'uncaughtException')
})
const defers = {}

8
src/logger/logger.js

@ -364,7 +364,13 @@ export default {
logger.log('error', ...args)
},
critical: (error: Error) => {
critical: (error: Error, context?: string) => {
if (context) {
captureBreadcrumb({
category: 'context',
message: context,
})
}
logger.log('error', error)
if (!process.env.STORYBOOK_ENV) {
try {

Loading…
Cancel
Save