pub(super) fn handler_factory( handler: ResolvedHandler, ) -> impl Fn() -> Result<ResolvedHandler, ApplicationError>