google / closure-stylesheets

A CSS+ transpiler that lints, optimizes, and I18n-izes
Apache License 2.0
314 stars 65 forks source link

Add css node declaration object to the GssError for better error reporting. #106

Open a701440 opened 7 years ago

a701440 commented 7 years ago

The code in CSS validation does not send failing CSS node to the error manager. Having the node object can provide more information for richer error reporting (i.e. print parent node content, etc.)

Current code in places like processDeclaration:

errorManager.report(new GssError(ERROR_STR + declaration, location));

Change to something like:

errorManager.report(new GssError(ERROR_STR + declaration, location, declaration));