Skip to content

Commit f48e424

Browse files
committed
fixed misleading error message due to defaluting errors to the last check, this fixes w3c#264
1 parent b3d49ae commit f48e424

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

org/w3c/css/properties/css3/CssTextDecoration.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,16 @@ public CssTextDecoration(ApplContext ac, CssExpression expression, boolean check
127127
}
128128
// if it fails, it must be a color, then...
129129
if (!match && colValue == null) {
130-
CssColor c = new CssColor(ac, expression, false);
131-
colValue = c.getColor();
132-
state *= 2;
130+
try {
131+
CssColor c = new CssColor(ac, expression, false);
132+
colValue = c.getColor();
133+
state *= 2;
134+
} catch (InvalidParamException iex) {
135+
// as it is a catchall, we do not know if the intent was a color
136+
// or something else, so let's use a generic message
137+
throw new InvalidParamException("value", val.toString(),
138+
getPropertyName(), ac);
139+
}
133140
// no need to check match, as if it is not a color
134141
// an exception would be fired
135142
}

0 commit comments

Comments
 (0)