Skip to content

Commit

Permalink
fixed try catch in versioned avro serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
abh1nay committed Oct 16, 2012
1 parent 1524721 commit d685b67
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -81,7 +81,11 @@ public byte[] toBytes(Object object) {
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
Expand All @@ -92,10 +96,6 @@ public byte[] toBytes(Object object) {
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);
}
Expand Down

0 comments on commit d685b67

Please sign in to comment.