SassError.js 887 B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. class SassError extends Error {
  7. constructor(sassError) {
  8. super();
  9. this.name = "SassError";
  10. this.originalSassError = sassError;
  11. this.loc = {
  12. line: sassError.line,
  13. column: sassError.column
  14. };
  15. // Keep original error if `sassError.formatted` is unavailable
  16. this.message = `${this.name}: ${this.originalSassError.message}`;
  17. if (this.originalSassError.formatted) {
  18. this.message = `${this.name}: ${this.originalSassError.formatted.replace(/^Error: /, "")}`;
  19. // Instruct webpack to hide the JS stack from the console.
  20. // Usually you're only interested in the SASS stack in this case.
  21. this.hideStack = true;
  22. Error.captureStackTrace(this, this.constructor);
  23. }
  24. }
  25. }
  26. var _default = exports.default = SassError;