NonErrorEmittedError.js 689 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const makeSerializable = require("../util/makeSerializable");
  7. const WebpackError = require("./WebpackError");
  8. class NonErrorEmittedError extends WebpackError {
  9. /**
  10. * @param {EXPECTED_ANY} error value which is not an instance of Error
  11. */
  12. constructor(error) {
  13. super();
  14. /** @type {string} */
  15. this.name = "NonErrorEmittedError";
  16. /** @type {string} */
  17. this.message = `(Emitted value instead of an instance of Error) ${error}`;
  18. }
  19. }
  20. makeSerializable(
  21. NonErrorEmittedError,
  22. "webpack/lib/errors/NonErrorEmittedError"
  23. );
  24. module.exports = NonErrorEmittedError;