Skip to content

Commit

Permalink
Stripping non-printable chars from connector error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Oct 17, 2015
1 parent ca38131 commit 2de7ae4
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -432,7 +432,9 @@ private static String createMessageFromAllExceptions(String prefix, Throwable ex
private static void addAllExceptionsToMessage(StringBuilder sb, Throwable ex) {
sb.append(ex.getClass().getName());
sb.append("(");
sb.append(ex.getMessage());
// Make sure that no non-printable chars shall pass
// e.g. AD LDAP produces non-printable chars in the messages
sb.append(ex.getMessage().replaceAll("\\p{C}", "?"));
sb.append(")");
if (ex.getCause() != null) {
sb.append("->");
Expand Down

0 comments on commit 2de7ae4

Please sign in to comment.