Skip to content

Commit 200eadd

Browse files
authored
[MODINVSTOR-1427] Fixed instance creation (folio-org#1208)
1 parent ad99207 commit 200eadd

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* Fix error serialization when writing to files uploaded to S3 ([MODINVSTOR-1389](https://folio-org.atlassian.net/browse/MODINVSTOR-1389))
2222
* Fix changes propagation to shadow instances after shared instance update ([MODINVSTOR-1393](https://folio-org.atlassian.net/browse/MODINVSTOR-1393))
2323
* Fix metadata not filled for records created via `POST /instance-storage/batch/synchronous`([MODINVSTOR-1382](https://folio-org.atlassian.net/browse/MODINVSTOR-1382))
24+
* Fixed random "`Cannot set holdings_record.instanceid = [...] because it does not exist in instance.id.`" errors when opening orders ([MODINVSTOR-1427](https://folio-org.atlassian.net/browse/MODINVSTOR-1427))
2425

2526
### Tech Dept
2627
* Description ([ISSUE](https://folio-org.atlassian.net/browse/ISSUE))

src/main/java/org/folio/services/instance/InstanceService.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ public Future<Response> createInstance(Instance entity) {
140140
return Future.succeededFuture(respond400WithTextPlain(response.getEntity()));
141141
}
142142
})
143-
.onSuccess(postResponse::complete)
144-
.onFailure(throwable -> {
145-
if (throwable instanceof PgException pgException) {
146-
postResponse.complete(respond400WithTextPlain(pgException.getDetail()));
147-
} else {
148-
postResponse.complete(respond400WithTextPlain(throwable.getMessage()));
149-
}
150-
})
151-
);
143+
)
144+
.onSuccess(postResponse::complete)
145+
.onFailure(throwable -> {
146+
if (throwable instanceof PgException pgException) {
147+
postResponse.complete(respond400WithTextPlain(pgException.getDetail()));
148+
} else {
149+
postResponse.complete(respond400WithTextPlain(throwable.getMessage()));
150+
}
151+
});
152152

153153
return postResponse.future()
154154
// Return the response without waiting for a domain event publish

0 commit comments

Comments
 (0)