Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed 404 handling on deletions #218

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## Unreleased

### Fixed

- A deletion of a nonexistant resource no longer leads to a client error

## [9.4.0](https://github.com/dbmdz/metadata-service/releases/tag/9.4.0) - 2024-12-06

### Added
Expand Down
2 changes: 1 addition & 1 deletion metasvc-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Client</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,14 @@ private HttpRequest createPutRequest(String requestUrl, Object bodyObject)
protected String doDeleteRequestForString(String requestUrl) throws TechnicalException {
HttpRequest req = createDeleteRequest(requestUrl);
try {
HttpResponse<String> response = http.send(req, HttpResponse.BodyHandlers.ofString());
HttpResponse<byte[]> response = http.send(req, HttpResponse.BodyHandlers.ofByteArray());
Integer statusCode = response.statusCode();
if (statusCode >= 400) {
throw HttpErrorDecoder.decode("DELETE " + requestUrl, statusCode, response);
}
String body = response.body();
if (body == null || body.isBlank()) {
// This is the most performant approach for Jackson
final byte[] body = response.body();
if (body == null || body.length == 0) {
return null;
}
String result = mapper.readerFor(String.class).readValue(body);
Expand Down
2 changes: 1 addition & 1 deletion metasvc-lobid-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: lobid.org Client</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Model</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/backend-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Backend API)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/backend-file/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Backend IMPL File)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/backend-inmemory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Backend IMPL InMemory)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/backend-jdbi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Backend IMPL JDBI PostgreSql)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/backend-lobid/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Backend IMPL External System lobid.org)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/business/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Business)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Webapp)</name>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc</artifactId>
<version>9.4.0</version>
<version>9.4.1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Metadata-Service</name>
Expand Down
Loading