Closed fasttime closed 1 year ago
Before you open this issue, please complete the following tasks:
Reporting this as a bug because it seems that the be behavior was not intended, but it could be also a feature.
The idea is that the output of a plugin-error should not include irrelevant information like the domainEmitter.
plugin-error
domainEmitter
Related: https://github.com/gulpjs/gulp/issues/1329
Currently the output includes a domainEmitter property with no helpful information when the error is emitted by a stream.
My actual use case involves a self-written gulp plugin that uses plugin-error behind the scenes.
The following is a minimal example that shows the problem:
// gulptask.js const gulp = require('gulp'); const PluginError = require('plugin-error'); const { PassThrough } = require('stream'); gulp.task('fail', function () { return new PassThrough({ final: cb => cb(new PluginError('my-plugin', 'My message')), objectMode: true }).end(); });
$ gulp fail
This will print:
Message: My message Details: domainEmitter: [object Object]
It would be great if the output could be just
Message: My message
npm -v
gulp -v
The simplest solution would be to domainEmitter to the set of ignored properties: https://github.com/gulpjs/plugin-error/blob/v2.0.0/index.js#L5-L15
I would gladly create a PR if the team agrees on this issue.
Duplicate of #14
Ah sorry, I saw the other issue but I thought it was related to console.log. I guess this can be closed then.
console.log
Before you open this issue, please complete the following tasks:
What were you expecting to happen?
Reporting this as a bug because it seems that the be behavior was not intended, but it could be also a feature.
The idea is that the output of a
plugin-error
should not include irrelevant information like thedomainEmitter
.Related: https://github.com/gulpjs/gulp/issues/1329
What actually happened?
Currently the output includes a
domainEmitter
property with no helpful information when the error is emitted by a stream.Please give us a sample of your gulpfile
My actual use case involves a self-written gulp plugin that uses plugin-error behind the scenes.
The following is a minimal example that shows the problem:
Terminal output / screenshots
This will print:
It would be great if the output could be just
Please provide the following information:
npm -v
): 8.19.2gulp -v
): 4.0.2Additional information
The simplest solution would be to
domainEmitter
to the set of ignored properties: https://github.com/gulpjs/plugin-error/blob/v2.0.0/index.js#L5-L15I would gladly create a PR if the team agrees on this issue.