@zengenti/contensis-react-base 3.0.2-beta.29 → 3.0.2-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3787,10 +3787,11 @@ const getVersionInfo = staticFolderPath => {
3787
3787
  };
3788
3788
 
3789
3789
  /* eslint-disable no-console */
3790
- const unhandledExceptionHandler = (handleExceptions = true) => {
3791
- const exceptionTypes = handleExceptions === true ? ['uncaughtException', 'unhandledRejection', 'SIGTERM', 'SIGINT'] // Default exception types to add event listeners for
3792
- : Array.isArray(handleExceptions) // In future we could accept an array of specific exception types to handle for a specific application?
3793
- ? handleExceptions : [];
3790
+
3791
+ // Default exception types to add event listeners for
3792
+ const handleDefaultEvents = ['uncaughtException', 'unhandledRejection'];
3793
+ const unhandledExceptionHandler = (handleExceptions = handleDefaultEvents) => {
3794
+ const exceptionTypes = Array.isArray(handleExceptions) ? handleExceptions : handleExceptions === false ? [] : handleDefaultEvents;
3794
3795
  for (const type of exceptionTypes) {
3795
3796
  process.on(type, err => {
3796
3797
  if (err && err instanceof Error) {
@@ -3826,7 +3827,7 @@ const webApp = (app, ReactApp, config) => {
3826
3827
  const attributes = stringifyAttributes(scripts.attributes);
3827
3828
  scripts.startup = scripts.startup || startupScriptFilename;
3828
3829
  const responseHandler = typeof handleResponses === 'function' ? handleResponses : handleResponse;
3829
- if (handleExceptions !== false) unhandledExceptionHandler(); // Create `process.on` event handlers for unhandled exceptions (Node v15+)
3830
+ if (handleExceptions !== false) unhandledExceptionHandler(handleExceptions); // Create `process.on` event handlers for unhandled exceptions (Node v15+)
3830
3831
 
3831
3832
  const versionInfo = getVersionInfo(staticFolderPath);
3832
3833
  app.get('/*', cookiesMiddleware__default["default"](), async (request, response) => {