[CHANGE] Sort GameVersions set & throw custom exception#4
Conversation
|
Are you happy with this PR, or do you still have anything else you want to add? |
I tested this by adding an invalid version to
I'll do this instead. |
2724e29 to
a009ecd
Compare
Done and tested:
Happy now it's tested (and fixed) I kept a |
This makes it easier to scan through valid versions.
This allows clients to catch and recover from unsupported game versions, which is useful as CurseForge are not consistent with which versions are supported.
a009ecd to
78f3459
Compare
|
I pushed an extra commit introducing See MinecraftFreecam/Publisher#29 for how a client could use it to implement retries. |
|
LMK if you'd like any changes, or moving anything to another PR. This is good to go from my perspective. Also LMK if you'd like the library to take more responsibility for filtering invalid |
|
Hey Sorry for the delay. Life has been hectic. I am happy with the changes made and they look good.
Honestly, no. Handling that should be up to the project implementing support. Everyone would have the own way of wanting to do thing, and in the end no one will agree 😅 |
As per my aside in #3, a sorted list of valid versions is easier to digest.
If I understandAlternatively, we could sort only when rendering the exception message.TObjectLongHashMap, the map is implemented as an array so insertion order is preserved. Therefore, I opted to sort before inserting.EDIT: added a custom
InvalidCurseVersionExceptionexception for clients to catch. This provides access to the full list of invalid versions used, and the full list of valid CurseForge versions. I believe that resolves #3 as clients can now catch, filter, and retry.