Skip to content

modrinth: version-from-modrinth-projects improved logging and error handling - #860

Merged
itzg merged 12 commits into
itzg:mainfrom
harrisonablack:fix/versionFromModrinthProjects
Sep 5, 2026
Merged

modrinth: version-from-modrinth-projects improved logging and error handling#860
itzg merged 12 commits into
itzg:mainfrom
harrisonablack:fix/versionFromModrinthProjects

Conversation

@harrisonablack

Copy link
Copy Markdown
Contributor

Revision of #854, added logging and error handling supporting #630, #676

Version Blame

When running version-from-modrinth-projects fails, and --debug is passed, logs are printed, noting which modrinth projects are blocking each Minecraft version.

./gradlew run --args="--debug version-from-modrinth-projects --loader=paper --projects=paper:viaversion,paper:viabackwards,paper:griefprevention,paper:discordsrv,paper:pl3xmap"
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 26.2 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 26.1.2 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 26.1.1 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 26.1 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21.11 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21.10 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21.9 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21.8 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21.7 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21.6 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21.5 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21.4 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21.3 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21.2 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21.1 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.21 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.20.6 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.345 DEBUG : Minecraft version 1.20.5 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.20.4 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.20.3 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.20.2 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.20.1 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.20 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.19.4 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.19.3 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.19.2 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.19.1 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.19 is blocked by projects [pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.18.2 is blocked by projects [griefprevention, pl3xmap]
[mc-image-helper] 00:13:20.346 DEBUG : Minecraft version 1.18.1 is blocked by projects [griefprevention, pl3xmap]

Empty and Null project Exceptions

When an empty projects list is passed, or no projects are parsed, InvalidParameterException is thrown

./gradlew run --args="version-from-modrinth-projects --projects= "
[mc-image-helper] 00:16:38.571 ERROR : Invalid parameter provided for 'version-from-modrinth-projects' command: No Modrinth projects parsed successfully, please ensure projects follow "<loader>:<project ID>|<slug>" and are delimited by commas
./gradlew run --args="version-from-modrinth-projects"
[mc-image-helper] 00:17:00.844 ERROR : Invalid parameter provided for 'version-from-modrinth-projects' command: No Modrinth projects provided, please provide at least one Modrinth project

Added tests asserting errors thrown for both cases.

ProjectRef parse tightening

Tightens initial ref passthrough; filtering whitespace and duplicate entries.

@itzg itzg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and slim! I'm good to merge, but just curious first on the GenericException

Comment thread src/main/java/me/itzg/helpers/modrinth/VersionFromModrinthProjectsCommand.java Outdated
@itzg itzg added the enhancement New feature or request label Sep 5, 2026
@itzg itzg changed the title fix: VersionFromModrinthProjectsCommand logging and error handling modrinth: version-from-modrinth-projects improved logging and error handling Sep 5, 2026
@itzg
itzg merged commit c700aee into itzg:main Sep 5, 2026
1 check passed
@harrisonablack
harrisonablack deleted the fix/versionFromModrinthProjects branch September 6, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add debug logs to see which contribute to "version from Modrinth" Version from Modrinth projects needs better error reporting

2 participants