Skip to content

Commit 06d7533

Browse files
fix: do not store original sass error in webpack error(#1053)
BREAGKING CHANGE: original sass error is not avalaible
1 parent 040a511 commit 06d7533

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/SassError.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ class SassError extends Error {
33
super();
44

55
this.name = "SassError";
6-
// TODO remove me in the next major release
7-
this.originalSassError = sassError;
86

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

1917
// Keep original error if `sassError.formatted` is unavailable
2018
this.message = `${this.name}: ${
21-
typeof this.originalSassError.message !== "undefined"
22-
? this.originalSassError.message
23-
: this.originalSassError
19+
typeof sassError.message !== "undefined" ? sassError.message : sassError
2420
}`;
2521

26-
if (this.originalSassError.formatted) {
27-
this.message = `${this.name}: ${this.originalSassError.formatted.replace(
22+
if (sassError.formatted) {
23+
this.message = `${this.name}: ${sassError.formatted.replace(
2824
/^Error: /,
2925
""
3026
)}`;

0 commit comments

Comments
 (0)