StatusPagesConfig

class StatusPagesConfig

A StatusPages plugin configuration.

Constructors

Link copied to clipboard
fun StatusPagesConfig()

Types

Link copied to clipboard
class StatusContext(call: <ERROR CLASS>, content: <ERROR CLASS>)

A context for status config method.

Functions

Link copied to clipboard
inline fun <T : Throwable> exception(noinline handler: suspend (<ERROR CLASS>, T) -> Unit)

Register an exception handler for the exception type T and its children.

fun <T : Throwable> exception(klass: KClass<T>, handler: suspend (<ERROR CLASS>, T) -> Unit)

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

Link copied to clipboard
fun status(vararg status: <ERROR CLASS>, handler: suspend (<ERROR CLASS>, <ERROR CLASS>) -> Unit)
@JvmName(name = "statusWithContext")
fun status(vararg status: <ERROR CLASS>, handler: suspend StatusPagesConfig.StatusContext.(<ERROR CLASS>) -> Unit)

Register a status handler for the status code.

Properties

Link copied to clipboard
val exceptions: MutableMap<KClass<*>, HandlerFunction>

Provides access to exception handlers of the exception class.

Link copied to clipboard
val statuses: MutableMap<<ERROR CLASS>, suspend (<ERROR CLASS>, <ERROR CLASS>, <ERROR CLASS>) -> Unit>

Provides access to status handlers based on a status code.

Extensions

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