WebpackError.js 660 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Jarid Margolin @jaridmargolin
  4. */
  5. "use strict";
  6. const inspect = require("util").inspect.custom;
  7. class WebpackError extends Error {
  8. /**
  9. * Creates an instance of WebpackError.
  10. * @param {string=} message error message
  11. */
  12. constructor(message) {
  13. super(message);
  14. this.details = undefined;
  15. this.missing = undefined;
  16. this.origin = undefined;
  17. this.dependencies = undefined;
  18. this.module = undefined;
  19. Error.captureStackTrace(this, this.constructor);
  20. }
  21. [inspect]() {
  22. return this.stack + (this.details ? `\n${this.details}` : "");
  23. }
  24. }
  25. module.exports = WebpackError;