Interface IMixinErrorHandler
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumAction to take when handling an error. -
Method Summary
Modifier and TypeMethodDescriptiononApplyError(String targetClassName, Throwable th, IMixinInfo mixin, IMixinErrorHandler.ErrorAction action) Called when an error occurs applying a mixin.onPrepareError(IMixinConfig config, Throwable th, IMixinInfo mixin, IMixinErrorHandler.ErrorAction action) Called when an error occurs whilst initialising a mixin config.
-
Method Details
-
onPrepareError
IMixinErrorHandler.ErrorAction onPrepareError(IMixinConfig config, Throwable th, IMixinInfo mixin, IMixinErrorHandler.ErrorAction action) Called when an error occurs whilst initialising a mixin config. This allows the plugin to display more user-friendly error messages if required.By default, when a critical error occurs the mixin processor will raise a warning if the config is not marked as "required" and will throw an
Errorif it is. This behaviour can be altered by returning different values from this method.The original throwable which was caught is passed in via the
thparameter and the default action is passed in to theactionparameter. A plugin can choose to output a friendly message but leave the original behaviour intact (by returningnullor returningactiondirectly. Alternatively it may throw a different exception or error, or can reduce the severity of the error by returning a differentIMixinErrorHandler.ErrorAction.- Parameters:
config- Config being prepared when the error occurredth- Throwable which was caughtmixin- Mixin which was being applied at the time of the erroraction- Default action- Returns:
- null to perform the default action (or return action) or new action to take
-
onApplyError
IMixinErrorHandler.ErrorAction onApplyError(String targetClassName, Throwable th, IMixinInfo mixin, IMixinErrorHandler.ErrorAction action) Called when an error occurs applying a mixin. This allows the plugin to display more user-friendly error messages if required.By default, when a critical error occurs the mixin processor will raise a warning if the config is not marked as "required" and will throw an
Errorif it is. This behaviour can be altered by returning different values from this method.The original throwable which was caught is passed in via the
thparameter and the default action is passed in to theactionparameter. A plugin can choose to output a friendly message but leave the original behaviour intact (by returningnullor returningactiondirectly. Alternatively it may throw a different exception or error, or can reduce the severity of the error by returning a differentIMixinErrorHandler.ErrorAction.- Parameters:
targetClassName- Class being transformed when the error occurredth- Throwable which was caughtmixin- Mixin which was being applied at the time of the erroraction- Default action- Returns:
- null to perform the default action (or return action) or new action to take
-