Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove domainEmitter from output #25

Closed
4 tasks done
fasttime opened this issue Dec 4, 2022 · 2 comments
Closed
4 tasks done

Remove domainEmitter from output #25

fasttime opened this issue Dec 4, 2022 · 2 comments

Comments

@fasttime
Copy link
Contributor

fasttime commented Dec 4, 2022

Before you open this issue, please complete the following tasks:

  • use the search bar at the top of the page to search this repository for similar issues or discussions that have already been opened.
  • if you are looking for help from the gulp team or community, open a discussion.
  • if you think there is a problem with the plugin you're using, open a discussion.
  • if you think there is a bug in our code, open this issue.

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 the domainEmitter.

Related: gulpjs/gulp#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:

// 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();
});

Terminal output / screenshots

$ 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

Please provide the following information:

  • OS & version: Windows 10
  • node version: 18.12.1
  • npm version (run npm -v): 8.19.2
  • gulp version (run gulp -v): 4.0.2

Additional 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-L15

I would gladly create a PR if the team agrees on this issue.

@phated
Copy link
Member

phated commented Dec 5, 2022

Duplicate of #14

@phated phated marked this as a duplicate of #14 Dec 5, 2022
@fasttime
Copy link
Contributor Author

fasttime commented Dec 5, 2022

Ah sorry, I saw the other issue but I thought it was related to console.log. I guess this can be closed then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants