public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
{
try {
$this->loadConfiguration();
$request = $this->dispatchPreConfigResolveEvent($request);
$configElement = $this->container->getService('response.config.resolver')->resolveConfigElement($request);
if (isset($configElement)) {
$this->dispatchRequestMatchEvent($configElement);
return $this->container->getService('response.builder')->build($configElement, $request);
}
return $this->container->getService('response.builder')->buildForMismatch($request);
} catch (\Exception $e) {
return $this->container->getService('response.builder')->buildForException($e);
}
}