Repository navigation
Display error rather than generate flaw for {{CSSSyntax}} - #4487
Conversation
|
The philosophy for flaws is that they are NOT warnings. They are things you/one should address if time wasn't an issue. |
| if (!formattedSyntax) { | ||
| throw new Error(`No syntax found in DB for '${name}'`); | ||
| formattedSyntax = "<span style=\"color:red;\">" + | ||
| `No syntax found in DB for '${name}'` + "</span>"; |
There was a problem hiding this comment.
Are you sure an inline block of <span> is correct use here? What about a <div class="notecard warning"> instead so there's consistency in alerts?
There was a problem hiding this comment.
I copied the style used in CSSInfo, but let's change this. I can even change the one in CSSInfo at the same time to have full consistency.
Let's do this.
|
To explain why the tests are failing... |
peterbe
left a comment
There was a problem hiding this comment.
If you merge teoli2003#1 I think this PR will start to pass CI.
|
@teoli2003 Perhaps as a follow-up it would be nice if you can change |
feedback on pr#4487
@peterbe , in my local dev branch, it doesn't show the warning. I of course can add a case where it does show the warning. Is this what you meant? |
|
@peterbe. Great news! I'll deal with these 4 last ones shortly, once I have some time :-) But another type of flaw is now well under control. Thanks a lot! |



In
{{CSSInfo}}(as well as in{{Specification}}and{{Compat}}, although the mechanism is different), when the structured data is missing, an error message is displayed.In
{{CSSSyntax}}, an exception is thrown, the name of the macro is displayed in the page, and a flaw is generated.The behavior of
{{CSSInfo}}is better: there is nothing wrong in the page (as the macro flaw hints) and the message helps diagnose and to fix the actual problem.This PR fixes this.
cc/ @peterbe: do you think you can still squeeze this review? The only issue in macros preventing me to go down to 0 for MacroExecutionError flaws :-)