Ignored all UnsupportedOperationExceptions from Extensions

Affects issues:
- Fixed #1667
This commit is contained in:
Risto Lahtela 2021-01-20 17:22:56 +02:00
parent d5a6ccc7a3
commit fd729360c7
2 changed files with 5 additions and 4 deletions

View File

@ -47,7 +47,8 @@ public class MethodWrapper<T> {
try {
return returnType.cast(with.usingOn(extension, method));
} catch (InvocationTargetException notReadyToBeCalled) {
if (notReadyToBeCalled.getCause() instanceof NotReadyException) {
if (notReadyToBeCalled.getCause() instanceof NotReadyException
|| notReadyToBeCalled.getCause() instanceof UnsupportedOperationException) {
return null; // Data or API not available to make the call.
} else {
throw new IllegalArgumentException(method.getDeclaringClass() + " method " + method.getName() + " could not be called: " + notReadyToBeCalled.getMessage(), notReadyToBeCalled);

View File

@ -140,7 +140,7 @@ public class ExtensionRegister {
try {
// Creates the extension with factory and registers it
createExtension.apply(factory).ifPresent(this::register);
} catch (NotReadyException ignore) {
} catch (NotReadyException | UnsupportedOperationException ignore) {
// This exception signals that the extension can not be registered right now (Intended fail).
} catch (Exception | NoClassDefFoundError | IncompatibleClassChangeError e) {
// Places all exceptions to one exception with plugin information so that they can be reported.
@ -155,7 +155,7 @@ public class ExtensionRegister {
try {
// Creates the extension with factory and registers it
createExtension.apply(factory).forEach(this::register);
} catch (NotReadyException ignore) {
} catch (NotReadyException | UnsupportedOperationException ignore) {
// This exception signals that the extension can not be registered right now (Intended fail).
} catch (Exception | NoClassDefFoundError | IncompatibleClassChangeError e) {
// Places all exceptions to one exception with plugin information so that they can be reported.
@ -173,7 +173,7 @@ public class ExtensionRegister {
createExtension.apply(factory)
.flatMap(this::register)
.ifPresent(caller -> registerListener.accept(factory, caller));
} catch (NotReadyException ignore) {
} catch (NotReadyException | UnsupportedOperationException ignore) {
// This exception signals that the extension can not be registered right now (Intended fail).
} catch (Exception | NoClassDefFoundError | IncompatibleClassChangeError e) {
// Places all exceptions to one exception with plugin information so that they can be reported.