Skip to content

Need docs for plugin error handling #130

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

Closed
pksjce opened this issue Sep 7, 2016 · 6 comments
Closed

Need docs for plugin error handling #130

pksjce opened this issue Sep 7, 2016 · 6 comments

Comments

@pksjce
Copy link

pksjce commented Sep 7, 2016

From @jasonkuhrt on April 4, 2015 17:8

I am trying to write a plugin for Webpack but unable to find documentation regarding how its error handling is supposed to work. For example if my plugin has a compile error on some file type I presumably should catch it and give it to webpack to present to the user. I cannot find guides or docs about this.

Copied from original issue: webpack/webpack#945

@pksjce
Copy link
Author

pksjce commented Sep 7, 2016

This issue was moved to #101

@bebraw
Copy link
Contributor

bebraw commented Oct 19, 2016

Closing in favor of #37 as plugin error handling should get covered in that doc.

@bebraw bebraw closed this as completed Oct 19, 2016
hzuhyb pushed a commit to hzuhyb/webpack.js.org that referenced this issue Feb 18, 2017
翻译 guides/code-splitting-libraries;guides/development
@EECOLOR
Copy link
Contributor

EECOLOR commented Mar 20, 2017

So time has moved forward about 2 years and still no answer.

Could you please provide a hint on how to report an error from a plugin?

@bebraw
Copy link
Contributor

bebraw commented Mar 21, 2017

@EECOLOR If you have access to compilation, you can do this:

compilation.warnings.push('warning');
compilation.errors.push('error');

@bebraw
Copy link
Contributor

bebraw commented Mar 21, 2017

Another way would be to throw an error. That would terminate the execution.

@EECOLOR
Copy link
Contributor

EECOLOR commented Mar 21, 2017

@bebraw Thank you! Exactly what I needed

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

No branches or pull requests

4 participants