CustomInterceptors

case
class CustomInterceptors[F[_], O](createOptions: CustomInterceptors[F, O] => O, metricsInterceptor: Option[MetricsRequestInterceptor[F]], rejectInterceptor: Option[RejectInterceptor[F]], exceptionHandler: Option[ExceptionHandler], serverLog: Option[ServerLog[F]], additionalInterceptors: List[Interceptor[F]], unsupportedMediaTypeInterceptor: Option[UnsupportedMediaTypeInterceptor[F]], decodeFailureHandler: DecodeFailureHandler)

Allows customising the interceptors used by the server interpreter. Custom interceptors can be added via addInterceptor, sitting between two configurable, default interceptor groups.

The order of the interceptors corresponds to the ordering of the parameters.

Moreover, built-in interceptors can be customised or disabled. Once done, use .options to obtain the server interpreter options to use.

Value Params
additionalInterceptors

Additional interceptors, e.g. handling decode failures, or providing alternate responses.

decodeFailureHandler

The decode failure handler, from which an interceptor will be created. Determines whether to respond when an input fails to decode.

exceptionHandler

Whether to respond to exceptions in the server logic, or propagate them to the server.

metricsInterceptor

Whether to collect metrics.

rejectInterceptor

How to respond when decoding fails for all interpreted endpoints.

serverLog

The server log using which an interceptor will be created, if any.

unsupportedMediaTypeInterceptor

Whether to return 415 (unsupported media type) if there's no body in the endpoint's outputs, which can satisfy the constraints from the Accept header.

trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def errorOutput(errorMessageOutput: String => ValuedEndpointOutput[_]): CustomInterceptors[F, O]

Customise the way error messages are rendered in error responses, using the default exception and decode failure handlers.

Customise the way error messages are rendered in error responses, using the default exception and decode failure handlers.

Creates the default interceptor stack

Creates the default interceptor stack

def options: O
def serverLog(log: Option[ServerLog[F]]): CustomInterceptors[F, O]

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product