Prevented some error logs on reload

This commit is contained in:
Rsl1122 2018-02-11 14:36:47 +02:00
parent 2b7f194d37
commit ea873f798e
3 changed files with 34 additions and 11 deletions

View File

@ -4,6 +4,7 @@
*/ */
package com.djrapitops.plan.system.settings.theme; package com.djrapitops.plan.system.settings.theme;
import com.djrapitops.plan.PlanPlugin;
import com.djrapitops.plan.api.exceptions.EnableException; import com.djrapitops.plan.api.exceptions.EnableException;
import com.djrapitops.plan.system.SubSystem; import com.djrapitops.plan.system.SubSystem;
import com.djrapitops.plan.system.settings.Settings; import com.djrapitops.plan.system.settings.Settings;
@ -69,6 +70,10 @@ public class Theme implements SubSystem {
} else { } else {
return value; return value;
} }
} catch (IllegalStateException e) {
if (!PlanPlugin.getInstance().isReloading()) {
Log.error("Something went wrong with getting variable " + variable.name() + " for: " + path);
}
} catch (Exception | NoSuchFieldError e) { } catch (Exception | NoSuchFieldError e) {
Log.error("Something went wrong with getting variable " + variable.name() + " for: " + path); Log.error("Something went wrong with getting variable " + variable.name() + " for: " + path);
} }

View File

@ -1,5 +1,6 @@
package com.djrapitops.plan.system.tasks.bukkit; package com.djrapitops.plan.system.tasks.bukkit;
import com.djrapitops.plan.PlanPlugin;
import com.djrapitops.plan.system.info.InfoSystem; import com.djrapitops.plan.system.info.InfoSystem;
import com.djrapitops.plan.system.info.connection.WebExceptionLogger; import com.djrapitops.plan.system.info.connection.WebExceptionLogger;
import com.djrapitops.plan.system.info.request.GenerateAnalysisPageRequest; import com.djrapitops.plan.system.info.request.GenerateAnalysisPageRequest;
@ -18,13 +19,20 @@ public class BootAnalysisTask extends AbsRunnable {
@Override @Override
public void run() { public void run() {
String bootAnalysisRunMsg = Locale.get(Msg.ENABLE_BOOT_ANALYSIS_RUN_INFO).toString(); try {
Log.info(bootAnalysisRunMsg); String bootAnalysisRunMsg = Locale.get(Msg.ENABLE_BOOT_ANALYSIS_RUN_INFO).toString();
if (!Analysis.isAnalysisBeingRun()) { Log.info(bootAnalysisRunMsg);
WebExceptionLogger.logIfOccurs(this.getClass(), () -> if (!Analysis.isAnalysisBeingRun()) {
InfoSystem.getInstance().sendRequest(new GenerateAnalysisPageRequest(ServerInfo.getServerUUID())) WebExceptionLogger.logIfOccurs(this.getClass(), () ->
); InfoSystem.getInstance().sendRequest(new GenerateAnalysisPageRequest(ServerInfo.getServerUUID()))
);
}
} catch (IllegalStateException e) {
if (!PlanPlugin.getInstance().isReloading()) {
Log.toLog(this.getClass(), e);
}
} finally {
cancel();
} }
cancel();
} }
} }

View File

@ -1,10 +1,12 @@
package com.djrapitops.plan.system.tasks.bukkit; package com.djrapitops.plan.system.tasks.bukkit;
import com.djrapitops.plan.PlanPlugin;
import com.djrapitops.plan.system.info.InfoSystem; import com.djrapitops.plan.system.info.InfoSystem;
import com.djrapitops.plan.system.info.connection.WebExceptionLogger; import com.djrapitops.plan.system.info.connection.WebExceptionLogger;
import com.djrapitops.plan.system.info.request.GenerateAnalysisPageRequest; import com.djrapitops.plan.system.info.request.GenerateAnalysisPageRequest;
import com.djrapitops.plan.system.info.server.ServerInfo; import com.djrapitops.plan.system.info.server.ServerInfo;
import com.djrapitops.plan.utilities.analysis.Analysis; import com.djrapitops.plan.utilities.analysis.Analysis;
import com.djrapitops.plugin.api.utility.log.Log;
import com.djrapitops.plugin.task.AbsRunnable; import com.djrapitops.plugin.task.AbsRunnable;
public class PeriodicAnalysisTask extends AbsRunnable { public class PeriodicAnalysisTask extends AbsRunnable {
@ -15,10 +17,18 @@ public class PeriodicAnalysisTask extends AbsRunnable {
@Override @Override
public void run() { public void run() {
if (!Analysis.isAnalysisBeingRun()) { try {
WebExceptionLogger.logIfOccurs(this.getClass(), () -> if (!Analysis.isAnalysisBeingRun()) {
InfoSystem.getInstance().sendRequest(new GenerateAnalysisPageRequest(ServerInfo.getServerUUID())) WebExceptionLogger.logIfOccurs(this.getClass(), () ->
); InfoSystem.getInstance().sendRequest(new GenerateAnalysisPageRequest(ServerInfo.getServerUUID()))
);
}
} catch (IllegalStateException e) {
if (!PlanPlugin.getInstance().isReloading()) {
Log.toLog(this.getClass(), e);
}
} finally {
cancel();
} }
} }
} }