Skip to content

Commit

Permalink
fix: hide error stacktrace on Sass errors (#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-agius4 committed Jun 27, 2022
1 parent 5f0658e commit 5e6a61b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 50 deletions.
11 changes: 5 additions & 6 deletions src/SassError.js
Expand Up @@ -4,6 +4,11 @@ class SassError extends Error {

this.name = "SassError";

// Instruct webpack to hide the JS stack from the console.
// Usually you're only interested in the SASS error in this case.
this.hideStack = true;
Error.captureStackTrace(this, this.constructor);

if (
typeof sassError.line !== "undefined" ||
typeof sassError.column !== "undefined"
Expand All @@ -24,12 +29,6 @@ class SassError extends Error {
/^Error: /,
""
)}`;

// Instruct webpack to hide the JS stack from the console.
// Usually you're only interested in the SASS stack in this case.
this.hideStack = true;

Error.captureStackTrace(this, this.constructor);
}
}
}
Expand Down

0 comments on commit 5e6a61b

Please sign in to comment.