AbsaOSS / ABRiS

Avro SerDe for Apache Spark structured APIs.
Apache License 2.0
230 stars 75 forks source link

Improve exceptions during schema register #230

Closed jozefbakus closed 3 years ago

jozefbakus commented 3 years ago

Function register(subject: SchemaSubject, schema: Schema) SchemaManager.scala The exception could be thrown only if a schema is not compatible and an error message should be more clearer and state only that.

cerveada commented 3 years ago

I agree that the Error message could be better.

The Schema does not exist is not error, though. The exception is thrown if and only if the schema for the subject already exists and at the same time it is not compatible with the schema that you're trying to register.

I think reversing the if statement would make the code clearer.

The exceptions from schemaRegistryClient are not covered by this exception at all. At least that's what I see in the code.

jozefbakus commented 3 years ago

Yes, you are right, I've changed the issue.