Skip to content

Commit

Permalink
Avoid double "Error:" headers when reporting selector parse errors
Browse files Browse the repository at this point in the history
Closes #774
  • Loading branch information
nex3 committed Jul 25, 2019
1 parent 44b542f commit 382af49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/src/value.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down

0 comments on commit 382af49

Please sign in to comment.