iceberg icon indicating copy to clipboard operation
iceberg copied to clipboard

Core: Highlight property names with single quotes in JsonUtil error messages

Open nastra opened this issue 3 years ago • 2 comments

Sometimes one has to read the error message twice to figure out which property name was affected, thus highlighting the property name in the error message should make this clearer.

nastra avatar Aug 04 '22 07:08 nastra

I think it's better to put names like this after a : instead of adding characters that can get copied and moved to other places. Putting names after : still allows you to see when they are empty or null (e.g. Cannot find field: ) without adding non-whitespace characters.

rdblue avatar Aug 07 '22 22:08 rdblue

I think it's better to put names like this after a : instead of adding characters that can get copied and moved to other places. Putting names after : still allows you to see when they are empty or null (e.g. Cannot find field: ) without adding non-whitespace characters.

That makes sense, but how would we want to handle something like Cannot parse %s from non-array value: %s? I feel that Cannot parse '%s' from non-array value: %s improves readability. Or we could add the property name to the end in this particular case to have Cannot parse from non-array value: %s: %s.

nastra avatar Aug 08 '22 06:08 nastra

we could add the property name to the end in this particular case to have Cannot parse from non-array value: %s: %s.

I prefer this approach to quotes. When needed, reword to make it clear that something is missing.

rdblue avatar Aug 14 '22 17:08 rdblue

@rdblue updated and pushed

nastra avatar Aug 15 '22 08:08 nastra