|
9 | 9 | import java.time.Duration;
|
10 | 10 | import java.util.Collection;
|
11 | 11 | import java.util.HashMap;
|
| 12 | +import java.util.List; |
12 | 13 | import java.util.Map;
|
| 14 | +import java.util.stream.Collectors; |
13 | 15 | import lombok.extern.slf4j.Slf4j;
|
14 | 16 | import me.itzg.helpers.cache.ApiCaching;
|
15 | 17 | import me.itzg.helpers.curseforge.model.Category;
|
@@ -174,19 +176,25 @@ public CurseForgeFile resolveModpackFile(
|
174 | 176 | .toObject(GetModFilesResponse.class)
|
175 | 177 | .execute();
|
176 | 178 |
|
177 |
| - return resp.getData().stream() |
| 179 | + final List<CurseForgeFile> files = resp.getData(); |
| 180 | + |
| 181 | + return files.stream() |
178 | 182 | .filter(file ->
|
179 | 183 | // even though we're preparing a server, we need client modpack to get deterministic manifest layout
|
180 | 184 | !file.isServerPack() &&
|
181 | 185 | (fileMatcher == null || file.getFileName().contains(fileMatcher)))
|
182 | 186 | .findFirst()
|
183 | 187 | .orElseThrow(() -> {
|
| 188 | + final String names = files.stream() |
| 189 | + .map(CurseForgeFile::getFileName) |
| 190 | + .collect(Collectors.joining(",")); |
| 191 | + |
184 | 192 | log.debug("No matching files for mod id={} name={} trying fileMatcher={}, sample of latest files={}",
|
185 | 193 | mod.getId(), mod.getName(),
|
186 | 194 | fileMatcher, mod.getLatestFiles()
|
187 | 195 | );
|
188 |
| - return new GenericException(String.format("No matching files found for mod '%s' (%d) using fileMatcher '%s'", |
189 |
| - mod.getSlug(), mod.getId(), fileMatcher) |
| 196 | + return new GenericException(String.format("No matching files found for mod '%s' (%d) using fileMatcher '%s': %s", |
| 197 | + mod.getSlug(), mod.getId(), fileMatcher, names) |
190 | 198 | );
|
191 | 199 | });
|
192 | 200 | }
|
|
0 commit comments