public Exception readError(Schema writer, Schema reader, Decoder in)
throws IOException {
Object error = new GenericDatumReader<Object>(writer, reader).read(null,in);
if (error instanceof CharSequence)
return new AvroRuntimeException(error.toString()); // system error
return new AvroRemoteException(error);
}