a zip code crypto-currency system good for red ONLY

ModuleBuildError.js 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. const cutOffLoaderExecution = require("./ErrorHelpers").cutOffLoaderExecution;
  8. class ModuleBuildError extends WebpackError {
  9. constructor(module, err) {
  10. super();
  11. this.name = "ModuleBuildError";
  12. this.message = "Module build failed: ";
  13. if(err !== null && typeof err === "object") {
  14. if(typeof err.stack === "string" && err.stack) {
  15. var stack = cutOffLoaderExecution(err.stack);
  16. if(!err.hideStack) {
  17. this.message += stack;
  18. } else {
  19. this.details = stack;
  20. if(typeof err.message === "string" && err.message) {
  21. this.message += err.message;
  22. } else {
  23. this.message += err;
  24. }
  25. }
  26. } else if(typeof err.message === "string" && err.message) {
  27. this.message += err.message;
  28. } else {
  29. this.message += err;
  30. }
  31. }
  32. this.module = module;
  33. this.error = err;
  34. Error.captureStackTrace(this, this.constructor);
  35. }
  36. }
  37. module.exports = ModuleBuildError;