Skip to content

ContentNotFoundError kills the process #126

@liviuignat

Description

@liviuignat

Hi,

With the latest version we've seen that ContentNotFoundError error kills the process. To be safe we added ignore: [/.*/] just to ignore all errors that might kill the process, but it would be nice to still have an ability to log them.

if (Array.isArray(err)) {
      // check ignore warnings array before killing child
      if (options.ignore && options.ignore instanceof Array) {
        var ignoreError = false;
        options.ignore.forEach(function(opt) {
          err.forEach(function(error) {
            if (typeof opt === 'string' && opt === error) {
              ignoreError = true;
            }
            if (opt instanceof RegExp && error.match(opt)) {
              ignoreError = true;
            }
          });
        });
        if (ignoreError) {
          return true; // ---->>>> maybe still throw a callback where errors can be logged here and then return.
        }
      }
      errObj = new Error(err.join('\n'));
    } else if (err) {
      errObj =  new Error(err);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions