diff --git a/Plan/common/src/main/java/com/djrapitops/plan/exceptions/connection/NotFoundException.java b/Plan/api/src/main/java/com/djrapitops/plan/delivery/web/resolver/exception/NotFoundException.java similarity index 75% rename from Plan/common/src/main/java/com/djrapitops/plan/exceptions/connection/NotFoundException.java rename to Plan/api/src/main/java/com/djrapitops/plan/delivery/web/resolver/exception/NotFoundException.java index c4ef335d5..c40aa6763 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/exceptions/connection/NotFoundException.java +++ b/Plan/api/src/main/java/com/djrapitops/plan/delivery/web/resolver/exception/NotFoundException.java @@ -14,14 +14,16 @@ * You should have received a copy of the GNU Lesser General Public License * along with Plan. If not, see . */ -package com.djrapitops.plan.exceptions.connection; +package com.djrapitops.plan.delivery.web.resolver.exception; /** - * Thrown when Connection returns 404, when page is not found. + * Throw this exception when a Resolver can not resolve a path. + *

+ * Plan will create a "404 Not found" error page automatically. * * @author Rsl1122 */ -public class NotFoundException extends WebException { +public class NotFoundException extends IllegalArgumentException { public NotFoundException(String message) { super(message); } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/Exporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/Exporter.java index 9b0d6af40..7f8dddc41 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/Exporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/Exporter.java @@ -16,8 +16,8 @@ */ package com.djrapitops.plan.delivery.export; +import com.djrapitops.plan.delivery.web.resolver.exception.NotFoundException; import com.djrapitops.plan.exceptions.ExportException; -import com.djrapitops.plan.exceptions.connection.NotFoundException; import com.djrapitops.plan.identification.Server; import com.djrapitops.plan.settings.config.PlanConfig; import com.djrapitops.plan.settings.config.paths.ExportSettings; diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java index 6da79caaa..9e7a73b10 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java @@ -19,9 +19,9 @@ package com.djrapitops.plan.delivery.export; import com.djrapitops.plan.delivery.rendering.pages.Page; import com.djrapitops.plan.delivery.rendering.pages.PageFactory; import com.djrapitops.plan.delivery.web.resolver.Response; +import com.djrapitops.plan.delivery.web.resolver.exception.NotFoundException; import com.djrapitops.plan.delivery.web.resolver.request.Request; import com.djrapitops.plan.delivery.webserver.resolver.json.RootJSONResolver; -import com.djrapitops.plan.exceptions.connection.NotFoundException; import com.djrapitops.plan.exceptions.connection.WebException; import com.djrapitops.plan.identification.Server; import com.djrapitops.plan.settings.theme.Theme; diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java index ab5b90a07..9aaa095eb 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java @@ -19,9 +19,9 @@ package com.djrapitops.plan.delivery.export; import com.djrapitops.plan.delivery.rendering.pages.Page; import com.djrapitops.plan.delivery.rendering.pages.PageFactory; import com.djrapitops.plan.delivery.web.resolver.Response; +import com.djrapitops.plan.delivery.web.resolver.exception.NotFoundException; import com.djrapitops.plan.delivery.web.resolver.request.Request; import com.djrapitops.plan.delivery.webserver.resolver.json.RootJSONResolver; -import com.djrapitops.plan.exceptions.connection.NotFoundException; import com.djrapitops.plan.exceptions.connection.WebException; import com.djrapitops.plan.settings.theme.Theme; import com.djrapitops.plan.storage.database.DBSystem; diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java index 2e39ceaef..cceaa71c1 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java @@ -19,9 +19,9 @@ package com.djrapitops.plan.delivery.export; import com.djrapitops.plan.delivery.rendering.pages.Page; import com.djrapitops.plan.delivery.rendering.pages.PageFactory; import com.djrapitops.plan.delivery.web.resolver.Response; +import com.djrapitops.plan.delivery.web.resolver.exception.NotFoundException; import com.djrapitops.plan.delivery.web.resolver.request.Request; import com.djrapitops.plan.delivery.webserver.resolver.json.RootJSONResolver; -import com.djrapitops.plan.exceptions.connection.NotFoundException; import com.djrapitops.plan.exceptions.connection.WebException; import com.djrapitops.plan.identification.ServerInfo; import com.djrapitops.plan.settings.theme.Theme; diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java index a313a8ee0..10af15990 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java @@ -19,9 +19,9 @@ package com.djrapitops.plan.delivery.export; import com.djrapitops.plan.delivery.rendering.pages.Page; import com.djrapitops.plan.delivery.rendering.pages.PageFactory; import com.djrapitops.plan.delivery.web.resolver.Response; +import com.djrapitops.plan.delivery.web.resolver.exception.NotFoundException; import com.djrapitops.plan.delivery.web.resolver.request.Request; import com.djrapitops.plan.delivery.webserver.resolver.json.RootJSONResolver; -import com.djrapitops.plan.exceptions.connection.NotFoundException; import com.djrapitops.plan.exceptions.connection.WebException; import com.djrapitops.plan.identification.Server; import com.djrapitops.plan.identification.ServerInfo; diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PageFactory.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PageFactory.java index a9336f9f7..f56a592e4 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PageFactory.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/pages/PageFactory.java @@ -19,7 +19,7 @@ package com.djrapitops.plan.delivery.rendering.pages; import com.djrapitops.plan.delivery.domain.container.PlayerContainer; import com.djrapitops.plan.delivery.formatting.Formatters; import com.djrapitops.plan.delivery.rendering.html.icon.Icon; -import com.djrapitops.plan.exceptions.connection.NotFoundException; +import com.djrapitops.plan.delivery.web.resolver.exception.NotFoundException; import com.djrapitops.plan.extension.implementation.results.ExtensionData; import com.djrapitops.plan.extension.implementation.storage.queries.ExtensionPlayerDataQuery; import com.djrapitops.plan.identification.Server; diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/ResponseFactory.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/ResponseFactory.java index 537a6c8c3..f333a9129 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/ResponseFactory.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/ResponseFactory.java @@ -23,9 +23,9 @@ import com.djrapitops.plan.delivery.rendering.pages.Page; import com.djrapitops.plan.delivery.rendering.pages.PageFactory; import com.djrapitops.plan.delivery.web.resolver.MimeType; import com.djrapitops.plan.delivery.web.resolver.Response; +import com.djrapitops.plan.delivery.web.resolver.exception.NotFoundException; import com.djrapitops.plan.delivery.webserver.auth.FailReason; import com.djrapitops.plan.exceptions.WebUserAuthException; -import com.djrapitops.plan.exceptions.connection.NotFoundException; import com.djrapitops.plan.settings.locale.Locale; import com.djrapitops.plan.settings.locale.lang.ErrorPageLang; import com.djrapitops.plan.settings.theme.Theme; diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/ResponseResolver.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/ResponseResolver.java index bbd9ac9bb..6a04835f0 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/ResponseResolver.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/webserver/ResponseResolver.java @@ -22,13 +22,13 @@ import com.djrapitops.plan.delivery.web.resolver.NoAuthResolver; import com.djrapitops.plan.delivery.web.resolver.Resolver; import com.djrapitops.plan.delivery.web.resolver.Response; import com.djrapitops.plan.delivery.web.resolver.exception.BadRequestException; +import com.djrapitops.plan.delivery.web.resolver.exception.NotFoundException; import com.djrapitops.plan.delivery.web.resolver.request.Request; import com.djrapitops.plan.delivery.webserver.auth.Authentication; import com.djrapitops.plan.delivery.webserver.resolver.*; import com.djrapitops.plan.delivery.webserver.resolver.json.RootJSONResolver; import com.djrapitops.plan.exceptions.WebUserAuthException; import com.djrapitops.plan.exceptions.connection.ForbiddenException; -import com.djrapitops.plan.exceptions.connection.NotFoundException; import com.djrapitops.plugin.logging.L; import com.djrapitops.plugin.logging.error.ErrorHandler; import dagger.Lazy; diff --git a/Plan/common/src/test/java/com/djrapitops/plan/delivery/webserver/HttpsServerTest.java b/Plan/common/src/test/java/com/djrapitops/plan/delivery/webserver/HttpsServerTest.java index 1b0967fee..5094abba0 100644 --- a/Plan/common/src/test/java/com/djrapitops/plan/delivery/webserver/HttpsServerTest.java +++ b/Plan/common/src/test/java/com/djrapitops/plan/delivery/webserver/HttpsServerTest.java @@ -17,8 +17,8 @@ package com.djrapitops.plan.delivery.webserver; import com.djrapitops.plan.delivery.web.resolver.exception.BadRequestException; +import com.djrapitops.plan.delivery.web.resolver.exception.NotFoundException; import com.djrapitops.plan.exceptions.connection.ForbiddenException; -import com.djrapitops.plan.exceptions.connection.NotFoundException; import com.djrapitops.plan.exceptions.connection.WebException; import com.djrapitops.plan.utilities.Base64Util; import org.junit.jupiter.api.Test;