8000 bug #20010 [DX] Fixed regression when exception message swallowed whe… · enumag/symfony@d842307 · GitHub
[go: up one dir, main page]

Skip to content

Commit d842307

Browse files
committed
bug symfony#20010 [DX] Fixed regression when exception message swallowed when logging it. (Koc)
This PR was merged into the 2.7 branch. Discussion ---------- [DX] Fixed regression when exception message swallowed when logging it. | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | maybe, wait for Travis | Fixed tickets | fixed regression introduced in symfony#13418 | License | MIT | Doc PR | - The problem is: after merging referenced PR we cann't understand what error occured and why authentication request failed (see attached screenshot). Previously it displays exception message, but now it only displays class of the exception. ![9003644109](https://cloud.githubusercontent.com/assets/191082/18717550/f0df61c4-8028-11e6-8dbb-684e4928e913.jpg) Commits ------- 042cb6b Fixed regression when exception message swallowed when logging it.
2 parents f7fc01d + 042cb6b commit d842307

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ private function sanitizeContext($context)
147147
}
148148

149149
if (is_object($context)) {
150+
if ($context instanceof \Exception) {
151+
return sprintf('Exception(%s): %s', get_class($context), $context->getMessage());
152+
}
153+
150154
return sprintf('Object(%s)', get_class($context));
151155
}
152156

0 commit comments

Comments
 (0)
0