Handle error message for schemas (#2520)
Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
This commit is contained in:
parent
9f32abcd09
commit
fc946a1dd1
1 changed files with 3 additions and 1 deletions
|
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue