♻️ Move throwing redirect exception into method
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / page / FreenetTemplatePage.kt
index 2dcef51..540f36e 100644 (file)
@@ -98,6 +98,9 @@ open class FreenetTemplatePage(
                /* do nothing. */
        }
 
+       fun redirectTo(target: String?): Nothing =
+                       throw RedirectException(target)
+
        class RedirectException(val target: String?) : Exception() {
                override fun toString(): String = format("RedirectException{target='%s'}", target)
        }