mbeckerle commented on a change in pull request #194: Fix poor diagnostic.
URL: https://github.com/apache/incubator-daffodil/pull/194#discussion_r263928868
##########
File path:
daffodil-lib/src/main/scala/org/apache/daffodil/cookers/EntityReplacer.scala
##########
@@ -652,7 +648,11 @@ sealed abstract class ListOfStringLiteralBase(
protected def cook(raw: String, context: ThrowsSDE, forUnparse: Boolean):
List[String] = {
if (raw.length != 0 && (raw.head.isWhitespace || raw.last.isWhitespace)) {
- context.SDE("The property '%s' cannot start or end with the string \"
\", did you mean to use '%%SP;' instead?", propNameArg)
+ val ws = if (raw.head.isWhitespace) raw.head else raw.last
+ val wsVisible = Misc.remapCodepointToVisibleGlyph(ws.toChar).toChar
+ val hexCodePoint = "%04x".format(ws.toInt)
+ context.SDE("The property '%s' cannot start or end with the string
\"%s\"(unicode hex code point U+%s), or consist entirely of whitespace."
+ + "\nDid you mean to use character entities like '%%SP;' or '%%NL;' to
indicate whitespace in the data format instead?", propNameArg, wsVisible,
hexCodePoint)
}
Review comment:
Unicode is proper noun. Should be capital "U".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services