Conversation
…or improved stability
Contain third-party failures during the annotation scan and at shutdown. - VersionFilter: catch Throwable instead of Exception, so a NoClassDefFoundError from a broken hook no longer aborts the whole scan, and always log the failure instead of only under debug - VersionFilter: guard version parsing of third-party plugins - ClassRegistry: stop swallowing constructor failures, report 'constructor threw' separately from a genuinely missing constructor - ZPlugin: add safeDisable and run every onDisable step through it, so a manager left half-built by a failed enable cannot skip config saving or service cleanup - Tests: ClassRegistryTest and PacketUtilsTest cover the contained failures
…r webhook checks and improve error logging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to error handling, robustness, and test coverage, especially around plugin integration and class loading. The changes ensure that failures in hooks or dependencies (such as missing plugins or broken APIs) are gracefully contained and reported, preventing them from affecting the rest of the system. Additionally, new tests have been added to verify these behaviors. There are also updates to build configurations and workflow files.
Error handling and robustness improvements:
ClassRegistryto properly report and contain exceptions or errors thrown during class instantiation, logging the real cause and preventing a single bad hook from aborting the scan. [1] [2]VersionFilterto catch and log version parsing errors and failures when loading classes, ensuring that issues with third-party plugins do not interrupt the registration process. [1] [2]PacketUtilsand related classes to check for API availability before performing actions, and to safely handle enabling/disabling when the API is missing or unavailable. [1] [2] [3] [4] [5] [6] [7]Test coverage:
ClassRegistryto verify that constructor errors are reported and contained as expected.PacketUtilsto ensure correct behavior when the API is missing, including readiness checks and error reporting.Build and workflow updates:
CommonandHooks/PacketEventsmodules to support new tests. [1] [2]Minor code cleanup:
ZInventoryManager.java.