if (!from.equals(to)) {
wsMessage.setReadablePayload(to);
}
} catch (IllegalArgumentException e) {
// e.g.: Illegal group reference when '$'-sign is used
throw new WebSocketException("Replacement text of WebSocket payload filter contains non-escaped characters (\\,$).", e);
} catch (StringIndexOutOfBoundsException e) {
// e.g.: String index out of range: 1 when '\' is used
throw new WebSocketException("Replacement text of WebSocket payload filter contains non-escaped characters (\\,$).", e);
}
}
}
}