ModuleDependencyError.js 812 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const WebpackError = require("./WebpackError");
  7. /** @typedef {import("./Module")} Module */
  8. class ModuleDependencyError extends WebpackError {
  9. /**
  10. * Creates an instance of ModuleDependencyError.
  11. * @param {Module} module module tied to dependency
  12. * @param {Error} err error thrown
  13. * @param {TODO} loc location of dependency
  14. */
  15. constructor(module, err, loc) {
  16. super(err.message);
  17. this.name = "ModuleDependencyError";
  18. this.details = err.stack
  19. .split("\n")
  20. .slice(1)
  21. .join("\n");
  22. this.module = module;
  23. this.loc = loc;
  24. this.error = err;
  25. this.origin = module.issuer;
  26. Error.captureStackTrace(this, this.constructor);
  27. }
  28. }
  29. module.exports = ModuleDependencyError;