mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-07 17:28:03 +08:00
Improve Extension error handling
This commit is contained in:
parent
5f0ecb8bbe
commit
de884cd681
@ -157,7 +157,7 @@ public class DataValueGatherer {
|
||||
addValuesToBuilder2(dataBuilder, methods, parameters);
|
||||
}
|
||||
|
||||
// TODO refactor to reduce cyclomatic complexity of the calling method
|
||||
// TODO refactor to reduce cyclomatic complexity of the calling method
|
||||
private void addValuesToBuilder2(ExtensionDataBuilder dataBuilder, ExtensionMethods methods, Parameters parameters) {
|
||||
for (ExtensionMethod provider : methods.getDataBuilderProviders()) {
|
||||
if (brokenMethods.contains(provider)) continue;
|
||||
@ -408,7 +408,10 @@ public class DataValueGatherer {
|
||||
.ifPresent(data -> storeTable(parameters, conditions, data));
|
||||
} catch (DataExtensionMethodCallException methodError) {
|
||||
logFailure(methodError);
|
||||
} catch (Exception | NoClassDefFoundError | NoSuchFieldError | NoSuchMethodError unexpectedError) {
|
||||
} catch (RejectedExecutionException ignore) {
|
||||
// Processing or Database has shut down, which can be ignored
|
||||
} catch (Exception | ExceptionInInitializerError | NoClassDefFoundError | NoSuchFieldError |
|
||||
NoSuchMethodError unexpectedError) {
|
||||
logFailure(unexpectedError);
|
||||
}
|
||||
}
|
||||
@ -584,7 +587,7 @@ public class DataValueGatherer {
|
||||
|
||||
private void storePlayerComponent(Parameters parameters, Conditions conditions, ComponentDataValue data) {
|
||||
ProviderInformation information = data.getInformation();
|
||||
String value = getComponentAsJson(getValue(conditions, data, information)) ;
|
||||
String value = getComponentAsJson(getValue(conditions, data, information));
|
||||
if (value == null) return;
|
||||
|
||||
Database db = dbSystem.getDatabase();
|
||||
|
@ -198,7 +198,7 @@ public class ExtensionRegister {
|
||||
createExtension.apply(factory).ifPresent(this::register);
|
||||
} catch (NotReadyException | UnsupportedOperationException ignore) {
|
||||
// This exception signals that the extension can not be registered right now (Intended fail).
|
||||
} catch (Exception | NoClassDefFoundError | IncompatibleClassChangeError e) {
|
||||
} catch (Exception | ExceptionInInitializerError | NoClassDefFoundError | IncompatibleClassChangeError e) {
|
||||
// Places all exceptions to one exception with plugin information so that they can be reported.
|
||||
suppressException(factory.getClass(), e);
|
||||
}
|
||||
@ -213,7 +213,7 @@ public class ExtensionRegister {
|
||||
createExtension.apply(factory).forEach(this::register);
|
||||
} catch (NotReadyException | UnsupportedOperationException ignore) {
|
||||
// This exception signals that the extension can not be registered right now (Intended fail).
|
||||
} catch (Exception | NoClassDefFoundError | IncompatibleClassChangeError e) {
|
||||
} catch (Exception | ExceptionInInitializerError | NoClassDefFoundError | IncompatibleClassChangeError e) {
|
||||
// Places all exceptions to one exception with plugin information so that they can be reported.
|
||||
suppressException(factory.getClass(), e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user