Fix session factory

This commit is contained in:
Art4 2024-11-19 07:46:52 +00:00
parent c1c158ccda
commit cde93c68dc

View file

@ -76,15 +76,21 @@ class Session
default: default:
$handler = null; $handler = null;
} }
$session = new Native($baseURL, $handler);
} catch (Throwable $e) { } catch (Throwable $e) {
$logger->notice('Unable to create session', ['mode' => $mode, 'session_handler' => $session_handler, 'exception' => $e]); $logger->notice('Unable to create session', ['mode' => $mode, 'session_handler' => $session_handler, 'exception' => $e]);
$session = new Memory(); $session = new Memory();
} finally {
$profiler->stopRecording(); $profiler->stopRecording();
return $session; return $session;
} }
try {
$session = new Native($baseURL, $handler);
} catch (Throwable $e) {
$logger->notice('Unable to create session', ['mode' => $mode, 'session_handler' => $session_handler, 'exception' => $e]);
$session = new Memory();
}
$profiler->stopRecording();
return $session;
} }
} }