X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FEditImagePage.kt;h=5443d28ff73048b2b4cc40bba8d9e317f7f9c06e;hp=76f6e23b711097cf9469099ba3afaae084858125;hb=aaf780d3c2a6f5ce47295786f3963c8b93f6a145;hpb=16cdb3cc357d30441ddcb13c8841f9928fdb0adb diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/EditImagePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/EditImagePage.kt index 76f6e23..5443d28 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/EditImagePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/EditImagePage.kt @@ -19,9 +19,9 @@ class EditImagePage @Inject constructor(webInterface: WebInterface, loaders: Loa override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) { if (soneRequest.isPOST) { - val image = soneRequest.core.getImage(soneRequest.httpRequest.getPartAsStringFailsafe("image", 36)) ?: throw RedirectException("invalid.html") + val image = soneRequest.core.getImage(soneRequest.httpRequest.getPartAsStringFailsafe("image", 36)) ?: redirectTo("invalid.html") if (!image.sone.isLocal) { - throw RedirectException("noPermission.html") + redirectTo("noPermission.html") } soneRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256).let { returnPage -> if (soneRequest.httpRequest.getPartAsStringFailsafe("moveLeft", 4) == "true") { @@ -38,10 +38,10 @@ class EditImagePage @Inject constructor(webInterface: WebInterface, loaders: Loa .update() soneRequest.core.touchConfiguration() } catch (e: ImageTitleMustNotBeEmpty) { - throw RedirectException("emptyImageTitle.html") + redirectTo("emptyImageTitle.html") } } - throw RedirectException(returnPage) + redirectTo(returnPage) } } }