private function dispatchInteropMiddleware(ServerMiddlewareInterface $middleware, callable $next, RequestInterface $request)
{
if ($middleware instanceof MiddlewarePipe && !$middleware->hasResponsePrototype() && $this->responsePrototype) {
$middleware->setResponsePrototype($this->responsePrototype);
}
if ($this->raiseThrowables) {
return $middleware->process($request, $next);
}
try {
return $middleware->process($request, $next);
} catch (Throwable $throwable) {
return $this->handleThrowableFromInteropMiddleware($throwable, $request, $next);
} catch (\Exception $exception) {
return $this->handleThrowableFromInteropMiddleware($exception, $request, $next);
}
}