Skip to content

Commit

Permalink
feat: improve the error message raised when the Avro schema is not fo…
Browse files Browse the repository at this point in the history
…und (#462)
  • Loading branch information
jak78 authored Feb 27, 2025
1 parent 65143bb commit 19cbfc5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,12 @@ public Schema getSchema(String name) {
return avroSchema;
}
schema = objects.getOrSelf("_kafka.schemas." + name.substring(0, name.length() - 1));
assertThat(schema).isInstanceOf(Schema.class);
assertThat(schema)
.overridingErrorMessage(
"The Avro schema for '" + name + "' was not found. You can follow the steps below to solve the issue:\n" +
"- ensure that the schema .avsc file has been correctly added using the 'avro schema' step. Doc: https://github.com/Decathlon/tzatziki/tree/main/tzatziki-spring-kafka#defining-an-avro-schema\n" +
"- confirm that the object '" + name + "' in your step matches the value of the 'name' property defined in the Avro schema.\n")
.isInstanceOf(Schema.class);
return (Schema) schema;
}

Expand Down

0 comments on commit 19cbfc5

Please sign in to comment.