dschneider-pivotal commented on a change in pull request #6926:
URL: https://github.com/apache/geode/pull/6926#discussion_r725363571
##########
File path:
geode-for-redis/src/main/java/org/apache/geode/redis/internal/netty/Coder.java
##########
@@ -141,6 +141,21 @@ public static ByteBuf getArrayResponse(ByteBuf buffer,
Collection<?> items,
return buffer;
}
+ public static void writeArrayResponse(ByteBuf buffer, Object... items) {
+ buffer.markWriterIndex();
+ try {
+ buffer.writeByte(ARRAY_ID);
+ appendAsciiDigitsToByteBuf(items.length, buffer);
+ buffer.writeBytes(bCRLF);
+ for (Object next : items) {
+ writeCollectionOrString(buffer, next, true);
+ }
+ } catch (CoderException e) {
+ buffer.resetWriterIndex();
+ getErrorResponse(buffer, "Internal server error: " + e.getMessage());
+ }
Review comment:
Good point. The CoderException/getErrorResponse is actually something
RedisResponse does. Publish is no longer using a RedisResponse but instead
directly writing to the buffer. I will change this new Coder method to be like
the others and put the exception handling in Publisher for now.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]