Skip to content

Commit 9296851

Browse files
committed
only rethrow exception when one is actually caught
1 parent 3107a08 commit 9296851

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/main/java/net/ornithemc/ploceus/LibraryUpgradesCache.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ private List<Library> getLibraries() {
111111
if (ce != null) {
112112
project.getLogger().warn("unable to read library upgrades from cache for gen" + intermediaryGeneration() + " " + minecraftVersion(), ce);
113113
}
114-
115-
throw new IllegalStateException("unable to fetch library upgrades from meta for gen" + intermediaryGeneration() + " " + minecraftVersion() + ", and it is not in the cache", me);
114+
if (me != null) {
115+
throw new IllegalStateException("unable to fetch library upgrades from meta for gen" + intermediaryGeneration() + " " + minecraftVersion() + ", and it is not in the cache", me);
116+
}
116117
}
117118

118119
return libs;

src/main/java/net/ornithemc/ploceus/OslVersionCache.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ private Map<String, String> getModuleBaseVersions(String version) {
135135
if (ce != null) {
136136
project.getLogger().warn("unable to read OSL module base versions from cache for gen" + intermediaryGeneration() + " " + version, ce);
137137
}
138-
139-
throw new IllegalStateException("unable to fetch OSL module base versions from meta for gen" + intermediaryGeneration() + " " + version + ", and it is not in the cache", me);
138+
if (me != null) {
139+
throw new IllegalStateException("unable to fetch OSL module base versions from meta for gen" + intermediaryGeneration() + " " + version + ", and it is not in the cache", me);
140+
}
140141
}
141142

142143
return baseVersions;
@@ -310,8 +311,9 @@ private String getModuleVersion(String module, String version, GameSide side) {
310311
if (ce != null) {
311312
project.getLogger().warn("unable to read OSL module version from cache for gen" + intermediaryGeneration() + " " + version, ce);
312313
}
313-
314-
throw new IllegalStateException("unable to fetch OSL module version from meta for gen" + intermediaryGeneration() + " " + version + ", and it is not in the cache", me);
314+
if (me != null) {
315+
throw new IllegalStateException("unable to fetch OSL module version from meta for gen" + intermediaryGeneration() + " " + version + ", and it is not in the cache", me);
316+
}
315317
}
316318

317319
return moduleVersion;

0 commit comments

Comments
 (0)