Package-level declarations

Types

Link copied to clipboard
open class BadRequestException(message: String, cause: Throwable? = null) : Exception

Base exception to indicate that the request is not correct due to wrong/missing request parameters, body content or header values. Throwing this exception in a handler will lead to 400 Bad Request response unless a custom io.ktor.plugins.StatusPages handler registered.

Link copied to clipboard

Thrown when content cannot be transformed to the desired type. It is not defined which status code will be replied when an exception of this type is thrown and not caught. Depending on child type it could be 4xx or 5xx status code. By default it will be 500 Internal Server Error.

Link copied to clipboard

This exception is thrown when a required parameter with name parameterName is missing

Link copied to clipboard

Represents a RequestConnectionPoint. Its every component is mutable so application plugins could modify them. By default, all the properties are equal to ApplicationRequest.local with RequestConnectionPoint.serverHost and RequestConnectionPoint.serverPort overridden by HttpHeaders.Host header value. Users can assign new values parsed from HttpHeaders.Forwarded, HttpHeaders.XForwardedHost, etc. See XForwardedHeaders and ForwardedHeaders.

Link copied to clipboard
class NotFoundException(message: String? = "Resource not found") : Exception

This exception means that the requested resource is not found. HTTP status 404 Not found will be replied when this exception is thrown and not caught. 404 status page could be configured by registering a custom io.ktor.plugins.StatusPages handler.

Link copied to clipboard
class ParameterConversionException(val parameterName: String, val type: String, cause: Throwable? = null) : BadRequestException, CopyableThrowable<ParameterConversionException>

This exception is thrown when a required parameter with name parameterName couldn't be converted to the type

Link copied to clipboard

Thrown when there is no conversion for a content type configured. HTTP status 415 Unsupported Media Type will be replied when this exception is thrown and not caught.

Properties

Link copied to clipboard

Represents request and connection parameters possibly overridden via https headers. By default, it fallbacks to ApplicationRequest.local