Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Print line number for CSS parse errors #484

Open
GoogleCodeExporter opened this issue Apr 6, 2015 · 6 comments
Open

Print line number for CSS parse errors #484

GoogleCodeExporter opened this issue Apr 6, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

Right now we print the byte number, but line numbers would be much more useful.

For example:

Function parameter contains unexpected char ''' at 168641 
"...dient(startColorstr='#b9e177', endColors..."
Could not parse function parameters for function 
progid:DXImageTransform.Microsoft.gradient at 168641 
"...dient(startColorstr='#b9e177', endColors..."
Ignored chars at end of function. at 168641 "...dient(startColorstr='#b9e177', 
endColors..."

Original issue reported on code.google.com by sligocki@google.com on 2 Aug 2012 at 3:22

@GoogleCodeExporter
Copy link
Author

More generally, we want to be able to type 
http://site?ModPagespeedFilters=+debug to give you HTML with comment 
annotations indicating why the system made various decisions.

As a Proof Of Concept that was already done for combine_css.  So we already 
have a filter called "debug", a query-param mechanism to incrementally add a 
new filter by name, and an API to insert a comment near the current event while 
calling filters.

We just need to put more of this information into filters.

One complexity with the CSS parser is that it is currently calling LOG(X) 
directly rather than going through something like our MessageHandler API where 
we can capture the results.  We'd need to refactor that in a way that would 
continue to work for the non-instaweb google3 users of the CSS parser.

-Josh

Original comment by jmara...@google.com on 28 Sep 2012 at 8:27

@GoogleCodeExporter
Copy link
Author

Josh, are you saying that you want the CSS parse errors to use the debug filter?
Where do the errors go today? Server logs?

The idea of adding comment annotations across all the filters sounds like it 
should be another bug (or somehow made part of the development standards).

Original comment by sl...@google.com on 28 Sep 2012 at 8:58

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Hey Josh, seems like you hijacked my bug into a completely separate issue.

The original bug was line numbers are not printed for CSS error messages. Your 
new bug is that we should print useful debug information for CssFilter (and 
others) for why a resource did not get optimized or perhaps errors encountered.

Original comment by sligocki@google.com on 28 Sep 2012 at 9:16

@GoogleCodeExporter
Copy link
Author

Perhaps you meant to comment on Issue 479?

Original comment by sligocki@google.com on 28 Sep 2012 at 9:17

@GoogleCodeExporter
Copy link
Author

Ah, perfect.  Already split :)  Unhijacking this one, which we can leave as 
still meaning to grab line numbers from the CSS parser.  Still assigning to 
slamm.

Original comment by jmara...@google.com on 28 Sep 2012 at 9:19

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant