Handle error message for schemas (#2520)

Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
This commit is contained in:
Daniel Ching 2022-09-14 19:00:46 -06:00 committed by GitHub
parent 9f32abcd09
commit fc946a1dd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,6 +66,7 @@ public class SchemaRegistryService {
private static final String UNRECOGNIZED_FIELD_SCHEMA_TYPE = "Unrecognized field: schemaType"; private static final String UNRECOGNIZED_FIELD_SCHEMA_TYPE = "Unrecognized field: schemaType";
private static final String INCOMPATIBLE_WITH_AN_EARLIER_SCHEMA = "incompatible with an earlier schema"; private static final String INCOMPATIBLE_WITH_AN_EARLIER_SCHEMA = "incompatible with an earlier schema";
private static final String INVALID_SCHEMA = "Invalid Schema";
private final WebClient webClient; private final WebClient webClient;
@ -237,7 +238,8 @@ public class SchemaRegistryService {
} else if (isIncompatibleSchemaMessage(x.getMessage())) { } else if (isIncompatibleSchemaMessage(x.getMessage())) {
return Mono.error(new SchemaCompatibilityException(x.getMessage())); return Mono.error(new SchemaCompatibilityException(x.getMessage()));
} else { } else {
return Mono.error(new UnprocessableEntityException(x.getMessage())); log.error(x.getMessage());
return Mono.error(new UnprocessableEntityException(INVALID_SCHEMA));
} }
} }