Permalink
Browse files

fixed try catch in versioned avro serializer

  • Loading branch information...
1 parent 1524721 commit d685b675fa2126970971db7307b73f3965ea7ed1 @abh1nay abh1nay committed Oct 16, 2012
View
10 src/java/voldemort/serialization/avro/versioned/AvroVersionedGenericSerializer.java
@@ -81,7 +81,11 @@ public AvroVersionedGenericSerializer(Map<Integer, String> typeDefVersions) {
datumWriter = new GenericDatumWriter<Object>(typeDef);
datumWriter.write(object, encoder);
encoder.flush();
- } catch(ArrayIndexOutOfBoundsException aIOBE) {
+ } catch(SerializationException sE) {
+ throw sE;
+ } catch(IOException e) {
+ throw new SerializationException(e);
+ } catch(Exception aIOBE) {
// probably the object sent to us was not created using the latest
// schema
@@ -92,10 +96,6 @@ public AvroVersionedGenericSerializer(Map<Integer, String> typeDefVersions) {
Integer writerVersion = getSchemaVersion(writer);
return toBytes(object, writer, writerVersion);
- } catch(IOException e) {
- throw new SerializationException(e);
- } catch(SerializationException sE) {
- throw sE;
} finally {
SerializationUtils.close(output);
}

0 comments on commit d685b67

Please sign in to comment.