Skip to content

Commit 06ae9c4

Browse files
Added code to print out byte array data (#305)
Co-authored-by: TwistedTwigleg <[email protected]>
1 parent e2cba66 commit 06ae9c4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
package software.amazon.awssdk.eventstreamrpc;
22

3+
import java.util.Arrays;
4+
35
public class DeserializationException extends RuntimeException {
46
public DeserializationException(Object lexicalData) {
57
this(lexicalData, null);
68
}
79

810
public DeserializationException(Object lexicalData, Throwable cause) {
9-
super("Could not deserialize data: [" + lexicalData.toString() + "]", cause);
11+
super("Could not deserialize data: [" + stringify(lexicalData) + "]", cause);
12+
}
13+
14+
private static String stringify(Object lexicalData) {
15+
if (lexicalData instanceof byte[]) {
16+
return Arrays.toString((byte[]) lexicalData);
17+
}
18+
19+
return lexicalData.toString();
1020
}
1121
}

0 commit comments

Comments
 (0)