1717
1818import com .datastax .oss .driver .shaded .guava .common .base .Preconditions ;
1919import java .io .IOException ;
20- import org .apache .tinkerpop .gremlin .driver .ser .SerializationException ;
2120import org .apache .tinkerpop .gremlin .structure .io .Buffer ;
2221import org .apache .tinkerpop .gremlin .structure .io .binary .DataType ;
2322import org .apache .tinkerpop .gremlin .structure .io .binary .GraphBinaryReader ;
@@ -78,8 +77,7 @@ public T read(Buffer buffer, GraphBinaryReader context) throws IOException {
7877 // read {custom_type_info_length} and verify it is 0.
7978 // See #write(T, ByteBuf, GraphBinaryWriter) for why it is set to 0
8079 if (context .readValue (buffer , Integer .class , false ) != 0 ) {
81- throw new SerializationException (
82- "{custom_type_info} should not be provided for this custom type" );
80+ throw new IOException ("{custom_type_info} should not be provided for this custom type" );
8381 }
8482
8583 return readValue (buffer , context , true );
@@ -105,11 +103,11 @@ public T readValue(Buffer buffer, GraphBinaryReader context, boolean nullable)
105103 final int valueLength = buffer .readInt ();
106104
107105 if (valueLength <= 0 ) {
108- throw new SerializationException (String .format ("Unexpected value length: %d" , valueLength ));
106+ throw new IOException (String .format ("Unexpected value length: %d" , valueLength ));
109107 }
110108
111109 if (valueLength > buffer .readableBytes ()) {
112- throw new SerializationException (
110+ throw new IOException (
113111 String .format (
114112 "Not enough readable bytes: %d bytes required for value (%d bytes available)" ,
115113 valueLength , buffer .readableBytes ()));
@@ -134,7 +132,7 @@ public void writeValue(
134132 throws IOException {
135133 if (value == null ) {
136134 if (!nullable ) {
137- throw new SerializationException ("Unexpected null value when nullable is false" );
135+ throw new IOException ("Unexpected null value when nullable is false" );
138136 }
139137
140138 // writes {value_flag} to "1" which means "the value is null"
0 commit comments