Skip to content

Commit

Permalink
better reporting for a bad schema
Browse files Browse the repository at this point in the history
  • Loading branch information
spullara committed Jun 5, 2011
1 parent 244b4de commit a7039d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion file/src/main/java/avrobase/file/FAB.java
Expand Up @@ -155,7 +155,11 @@ private Row<T, K> _get(K row) throws IOException {
Schema schema = schemaCache.get(hash); Schema schema = schemaCache.get(hash);
if (schema == null) { if (schema == null) {
File schemaFile = new File(schemaDir, hash); File schemaFile = new File(schemaDir, hash);
schema = Schema.parse(new FileInputStream(schemaFile)); try {
schema = Schema.parse(new FileInputStream(schemaFile));
} catch (IOException ioe) {
throw new AvroBaseException("Failed to read schema for hash: " + hash + " row: " + row, ioe);
}
schemaCache.put(hash, schema); schemaCache.put(hash, schema);
hashCache.put(schema, hash); hashCache.put(schema, hash);
} }
Expand Down

0 comments on commit a7039d6

Please sign in to comment.