setErrorPage

fun setErrorPage(layoutId: String? = NO_LAYOUT_FQN, initRouteMethod: InitRouteMethod? = null, pageMethod: PageMethod)(source)

Set a handler to call to render a page when the route is not found.

Kobweb provides a default error page but many sites may wish to customize this.

Overriding the error page in your project would look like this:

@InitKobweb
fun initErrorPage(ctx: InitKobwebContext) {
ctx.router.setErrorPage {
H1 { Text("Page not found!") }
}
}