Avoid double "Error:" headers when reporting selector parse errors

Closes #774
This commit is contained in:
Natalie Weizenbaum 2019-07-25 08:28:40 +01:00
parent 44b542fcef
commit 382af499e0
2 changed files with 5 additions and 3 deletions

View File

@ -2,6 +2,8 @@
* Include argument names when reporting range errors and selector parse errors.
* Avoid double `Error:` headers when reporting selector parse errors.
## 1.22.8
### JavaScript API

View File

@ -120,7 +120,7 @@ abstract class Value implements ext.Value {
} on SassFormatException catch (error) {
// TODO(nweiz): colorize this if we're running in an environment where
// that works.
throw _exception(error.toString(), name);
throw _exception(error.toString().replaceFirst("Error: ", ""), name);
}
}
@ -140,7 +140,7 @@ abstract class Value implements ext.Value {
} on SassFormatException catch (error) {
// TODO(nweiz): colorize this if we're running in an environment where
// that works.
throw _exception(error.toString(), name);
throw _exception(error.toString().replaceFirst("Error: ", ""), name);
}
}
@ -161,7 +161,7 @@ abstract class Value implements ext.Value {
} on SassFormatException catch (error) {
// TODO(nweiz): colorize this if we're running in an environment where
// that works.
throw _exception(error.toString(), name);
throw _exception(error.toString().replaceFirst("Error: ", ""), name);
}
}