refactor-architecture #43

Merged
rov merged 2 commits from refactor-architecture into main 2026-03-29 14:19:39 -03:00
Showing only changes of commit 7df2ea1b7a - Show all commits

View File

@ -71,12 +71,28 @@ public class MangaUpdateService {
}
private MangaDataDTO fetchExternalMangaData(Manga manga) {
Exception fetchException = null;
if (nonNull(manga.getAniListId())) {
return aniListService.getMangaDataById(manga.getAniListId());
try {
return aniListService.getMangaDataById(manga.getAniListId());
} catch (Exception e) {
log.warn("Failed to fetch manga data from AniList for Manga ID {}", manga.getId(), e);
fetchException = e;
}
}
if (nonNull(manga.getMalId())) {
return myAnimeListService.getMangaDataById(manga.getMalId());
try {
return myAnimeListService.getMangaDataById(manga.getMalId());
} catch (Exception e) {
log.warn("Failed to fetch manga data from MyAnimeList for Manga ID {}", manga.getId(), e);
fetchException = e;
}
}
if (nonNull(fetchException)) {
throw (RuntimeException) fetchException;
}
throw new IllegalStateException(