diff --git a/src/internals/index.js b/src/internals/index.js index 3d72e503..e6b17f04 100644 --- a/src/internals/index.js +++ b/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 = {} diff --git a/src/logger/logger.js b/src/logger/logger.js index 7f001def..7105124c 100644 --- a/src/logger/logger.js +++ b/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 {