Skip to content

Commit

Permalink
fix: do not store original sass error in webpack error(#1053)
Browse files Browse the repository at this point in the history
BREAGKING CHANGE: original sass error is not avalaible
  • Loading branch information
alexander-akait committed May 17, 2022
1 parent 040a511 commit 06d7533
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/SassError.js
Expand Up @@ -3,8 +3,6 @@ class SassError extends Error {
super();

this.name = "SassError";
// TODO remove me in the next major release
this.originalSassError = sassError;

if (
typeof sassError.line !== "undefined" ||
Expand All @@ -18,13 +16,11 @@ class SassError extends Error {

// Keep original error if `sassError.formatted` is unavailable
this.message = `${this.name}: ${
typeof this.originalSassError.message !== "undefined"
? this.originalSassError.message
: this.originalSassError
typeof sassError.message !== "undefined" ? sassError.message : sassError
}`;

if (this.originalSassError.formatted) {
this.message = `${this.name}: ${this.originalSassError.formatted.replace(
if (sassError.formatted) {
this.message = `${this.name}: ${sassError.formatted.replace(
/^Error: /,
""
)}`;
Expand Down

0 comments on commit 06d7533

Please sign in to comment.