Package io.ktor.server.plugins.statuspages

Types

Link copied to clipboard
typealias HandlerFunction = suspend (<ERROR CLASS>, cause: Throwable) -> Unit

Specifies how the exception should be handled.

Link copied to clipboard
class StatusPagesConfig

A StatusPages plugin configuration.

Functions

Link copied to clipboard
fun <T : Throwable> StatusPagesConfig.exception(klass: Class<T>, handler: suspend PipelineContext<Unit, ApplicationCall>.(T) -> Unit)

Register an exception handler for the exception class klass and its children

Link copied to clipboard
fun StatusPagesConfig.statusFile(vararg code: HttpStatusCode, filePattern: String)

Register a status page file(s) using filePattern for multiple status code list

Properties

Link copied to clipboard
val StatusPages: <ERROR CLASS><StatusPagesConfig>

A plugin that handles exceptions and status codes. Useful to configure default error pages.