Skip to content

Commit 8dc2586

Browse files
committed
fix: build
1 parent afc92cd commit 8dc2586

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

backend/src/main/java/ch/xxx/aidoclibchat/adapter/client/ImportRestClient.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
*/
1313
package ch.xxx.aidoclibchat.adapter.client;
1414

15+
import java.io.IOException;
1516
import java.util.List;
1617

1718
import org.springframework.stereotype.Component;
1819
import org.springframework.web.client.RestClient;
1920

2021
import com.fasterxml.jackson.dataformat.csv.CsvMapper;
22+
import com.fasterxml.jackson.dataformat.csv.CsvSchema;
2123
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
2224

2325
import ch.xxx.aidoclibchat.domain.client.ImportClient;
@@ -57,10 +59,14 @@ public List<Artist> importArtists() {
5759
}
5860

5961
private <T> List<T> mapString(String result, Class<T> myClass) {
60-
List<T> zipcodes = List.of();
61-
zipcodes = this.csvMapper.readerFor(myClass).with(CsvSchema.builder().setUseHeader(true).build())
62-
.<T>readValues(result).readAll();
63-
return zipcodes;
62+
List<T> zipcodes = List.of();
63+
try {
64+
zipcodes = this.csvMapper.readerFor(myClass).with(CsvSchema.builder().setUseHeader(true).build())
65+
.<T>readValues(result).readAll();
66+
} catch (IOException ex) {
67+
throw new RuntimeException("Error mapping CSV data", ex);
68+
}
69+
return zipcodes;
6470
}
6571

6672
@Override

0 commit comments

Comments
 (0)