Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hide error stacktrace on Sass errors #1069

Merged
merged 1 commit into from Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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