Browse Source

Merge pull request #1062 from gre/no-longer-exit-on-uncaughtException

uncaughtException: no longer exit(1)
master
NastiaS 7 years ago
committed by GitHub
parent
commit
bed23cf06e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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