remove try block

This commit is contained in:
Art4 2024-11-22 11:04:04 +00:00
parent bc76f2af67
commit c5ca4df389

View file

@ -334,17 +334,17 @@ class Router
$stamp = microtime(true); $stamp = microtime(true);
try {
/** @var ICanHandleRequests $module */ /** @var ICanHandleRequests $module */
return $this->dice->create($moduleClass, $this->parameters); $module = $this->dice->create($moduleClass, $this->parameters);
} finally {
if ($this->dice_profiler_threshold > 0) { if ($this->dice_profiler_threshold > 0) {
$dur = floatval(microtime(true) - $stamp); $dur = floatval(microtime(true) - $stamp);
if ($dur >= $this->dice_profiler_threshold) { if ($dur >= $this->dice_profiler_threshold) {
$this->logger->notice('Dice module creation lasts too long.', ['duration' => round($dur, 3), 'module' => $moduleClass, 'parameters' => $this->parameters]); $this->logger->notice('Dice module creation lasts too long.', ['duration' => round($dur, 3), 'module' => $moduleClass, 'parameters' => $this->parameters]);
} }
} }
}
return $module;
} }
/** /**