Skip to content

Commit

Permalink
#550 Avoid reading from possible closed response
Browse files Browse the repository at this point in the history
  • Loading branch information
Possommi committed Nov 4, 2024
1 parent ca465d8 commit 4d57153
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ public static SysValue update(String mcrid) {

try (HISInOneClient client = HISinOneClientFactory.create();
Response response = client.put(conf.getPath() + "/" + hisId, json)) {
SysValue p = response.readEntity(conf.getResponseEntityClass());

if (response.getStatusInfo().getFamily() != Response.Status.Family.SUCCESSFUL) {
LOGGER.error("HISinOne api error: {}", response.readEntity(String.class));
return SysValue.ErroneousSysValue;
}

SysValue p = response.readEntity(conf.getResponseEntityClass());
if (p.getId() == 0) {
LOGGER.error("MCRObject {} was not updated at {}({}) with id {}", mcrid, HIS_IN_ONE_BASE_URL,
conf.getPath(), p.getId());
Expand Down

0 comments on commit 4d57153

Please sign in to comment.