Skip to content

Commit b55ca2d

Browse files
committed
Fix decorator behavour
1 parent ee97de9 commit b55ca2d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Business/Executor/HttpExecutorLoggerAwareDecorator.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,17 @@ public function __construct(
3838
public function execute(Request $request, bool $flush = true): Response
3939
{
4040
$response = null;
41-
$exception = null;
4241
try {
4342
$response = $this->decorated->execute($request, $flush);
4443
} catch (\Throwable $throwable) {
45-
$exception = $throwable;
4644
$this->loggerError->critical(
47-
$this->logErrorFormatter->format($request, $response, $exception)
45+
$this->logErrorFormatter->format($request, $response, $throwable)
4846
);
4947

50-
throw $exception;
48+
throw $throwable;
5149
} finally {
5250
$this->loggerAccess->info(
53-
$this->logAccessFormatter->format($request, $response, $exception)
51+
$this->logAccessFormatter->format($request, $response, null)
5452
);
5553
}
5654

0 commit comments

Comments
 (0)