Scoop API

scoop:scoop.http.server:0.1.0

HttpApplicationOptions

class HttpApplicationOptions

source · line 4
public
public class HttpApplicationOptions internal constructor(
    /** Maps an uncommitted endpoint failure while its middleware Context remains installed. */
    public val errorMapper: suspend (HttpContext, Throwable) -> HttpResult =
        suspend { ctx, _ -> text("Internal Server Error\nRequest: " + ctx.requestId, 500U) },
    /** Observes failures outside internal locks; observer errors do not replace the primary cause. */
    public val onError: ((HttpContext, Throwable) -> Unit)? = None
)

Application-level error handling, independent of the server's transport configuration.

Extensions

property onError

source · line 9
public
public val onError: ((HttpContext, Throwable) -> Unit)? = None

get: public read-only

Observes failures outside internal locks; observer errors do not replace the primary cause.

property errorMapper

source · line 6
public
public val errorMapper: suspend (HttpContext, Throwable) -> HttpResult =
        suspend { ctx, _ -> text("Internal Server Error\nRequest: " + ctx.requestId, 500U) }

get: public read-only

Maps an uncommitted endpoint failure while its middleware Context remains installed.