You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using pprint in property based testing, where we create arbitrary strings. Sadly, pprint fails on some of those characters: Message: Unknown ansi-escape at index 3 inside string cannot be parsed into an fansi.Str
same thing here, crash in production, we are still using the lib but with a safe wrapper
objectPrettyPrintHelperextendsLazyLogging {
/** * Safe wrapper around pprint. * This method exists because of pprint not supporting some non-printable characters, * exploding with an exception when attempting to do so. * * See issue: https://github.com/com-lihaoyi/PPrint/issues/35*/defsafePrettyPrint(anyValue: Any):String= {
Try(BlackWhite.apply(anyValue).toString()).fold(err => {
logger.error(s"Failed to pretty print $anyValue with message: ${err.getMessage}", err)
anyValue.toString
}, identity)
}
}
We are using pprint in property based testing, where we create arbitrary strings. Sadly, pprint fails on some of those characters:
Message: Unknown ansi-escape at index 3 inside string cannot be parsed into an fansi.Str
Example:
The text was updated successfully, but these errors were encountered: