From 6d941766f1bfd0f983f131fc4f809c3a419c30c0 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Wed, 7 Feb 2018 11:43:30 +0200 Subject: [PATCH] Added warn notifications for dev mode error logs --- .../djrapitops/plan/system/info/connection/ConnectionOut.java | 1 + .../com/djrapitops/plan/system/webserver/RequestHandler.java | 3 ++- .../com/djrapitops/plan/system/webserver/webapi/WebAPI.java | 4 ---- .../plan/utilities/html/tables/PlayersTableCreator.java | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionOut.java b/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionOut.java index fd5b23ac5..63e49d338 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionOut.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionOut.java @@ -142,6 +142,7 @@ public class ConnectionOut { throw new ConnectionFailException("Connection timed out after 10 seconds.", e); } catch (NoSuchAlgorithmException | KeyManagementException | IOException e) { if (Settings.DEV_MODE.isTrue()) { + Log.warn("THIS ERROR IS ONLY LOGGED IN DEV MODE:"); Log.toLog(this.getClass().getName(), e); } ConnectionLog.logConnectionTo(toServer, infoRequest, -1); diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/RequestHandler.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/RequestHandler.java index 21fd069d1..f699040b7 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/RequestHandler.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/RequestHandler.java @@ -52,7 +52,8 @@ public class RequestHandler implements HttpHandler { response.send(exchange); } catch (Exception e) { if (Settings.DEV_MODE.isTrue()) { - e.printStackTrace(); + Log.warn("THIS ERROR IS ONLY LOGGED IN DEV MODE:"); + Log.toLog(this.getClass(), e); } } finally { exchange.close(); diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/webapi/WebAPI.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/webapi/WebAPI.java index 40535a241..1a09257d2 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/webapi/WebAPI.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/webapi/WebAPI.java @@ -6,7 +6,6 @@ package com.djrapitops.plan.system.webserver.webapi; import com.djrapitops.plan.api.exceptions.connection.*; import com.djrapitops.plan.system.info.server.ServerInfo; -import com.djrapitops.plan.system.settings.Settings; import com.djrapitops.plan.system.webserver.response.Response; import com.djrapitops.plan.system.webserver.response.api.BadRequestResponse; import com.djrapitops.plan.system.webserver.response.api.SuccessResponse; @@ -125,9 +124,6 @@ public abstract class WebAPI { } catch (SocketTimeoutException e) { throw new ConnectionFailException("Connection timed out after 10 seconds.", e); } catch (NoSuchAlgorithmException | KeyManagementException | IOException e) { - if (Settings.DEV_MODE.isTrue()) { - Log.toLog(this.getClass().getName(), e); - } throw new ConnectionFailException("API connection failed. address: " + address, e); } } diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/PlayersTableCreator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/PlayersTableCreator.java index 3afbb48cc..07cc2bfb4 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/PlayersTableCreator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/PlayersTableCreator.java @@ -75,6 +75,7 @@ public class PlayersTableCreator { )); } catch (NullPointerException e) { if (Settings.DEV_MODE.isTrue()) { + Log.warn("THIS ERROR IS ONLY LOGGED IN DEV MODE:"); Log.toLog(PlayersTableCreator.class.getName(), e); } }