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 authored 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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 5e6a61b

Please sign in to comment.