Skip to content

Commit

Permalink
Do not return -1 from register call
Browse files Browse the repository at this point in the history
  • Loading branch information
big-andy-coates committed Mar 25, 2019
1 parent 5b839b3 commit f1d6d42
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@ private int getIdFromRegistry(String subject, Schema schema, boolean registerReq
if (schemaId == null) {
id = id >= 0 ? id : ids.incrementAndGet();
schemaIdCache.put(schema, id);
schemaId = id;
} else if (id >= 0 && id != schemaId) {
throw new IllegalStateException("Schema already registered with id "
+ schemaId + " instead of input id " + id);
}
idSchemaMap.put(id, schema);
idSchemaMap.put(schemaId, schema);
idCache.put(subject, idSchemaMap);
generateVersion(subject, schema);
return id;
return schemaId;
} else {
throw new RestClientException("Schema Not Found", 404, 404001);
}
Expand Down

0 comments on commit f1d6d42

Please sign in to comment.