Skip to content

Commit a9e6b04

Browse files
committed
Handle AvroRuntimeException to avoid validation request failed with 500 status code
1 parent b56c806 commit a9e6b04

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/io/confluent/kafka/connect/datagen/ConfigUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ public static Schema getSchemaFromSchemaString(String schemaString) {
3535
Schema schema;
3636
try {
3737
schema = schemaParser.parse(schemaString);
38-
} catch (SchemaParseException e) {
38+
} catch (SchemaParseException | AvroRuntimeException e) {
3939
log.error("Unable to parse the provided schema", e);
4040
throw new ConfigException("Unable to parse the provided schema");
41-
}
41+
4242
return schema;
4343
}
4444

@@ -56,11 +56,11 @@ public static Schema getSchemaFromSchemaFileName(String schemaFileName) {
5656
schema = schemaParser.parse(
5757
DatagenTask.class.getClassLoader().getResourceAsStream(schemaFileName)
5858
);
59-
} catch (SchemaParseException | IOException i) {
59+
} catch (SchemaParseException | AvroRuntimeException | IOException i) {
6060
log.error("Unable to parse the provided schema", i);
6161
throw new ConfigException("Unable to parse the provided schema");
6262
}
63-
} catch (SchemaParseException | IOException e) {
63+
} catch (SchemaParseException | AvroRuntimeException | IOException e) {
6464
log.error("Unable to parse the provided schema", e);
6565
throw new ConfigException("Unable to parse the provided schema");
6666
}

0 commit comments

Comments
 (0)