Skip to content

Commit

Permalink
Merge pull request #17665 from markusramsak/patch-22
Browse files Browse the repository at this point in the history
Add Stack Trace to new Logging (since 5.0.7) in WebExceptionRenderer.php
  • Loading branch information
markstory committed Apr 13, 2024
2 parents bb9d874 + d09e934 commit 8f56e52
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Error/Renderer/WebExceptionRenderer.php
Expand Up @@ -189,7 +189,8 @@ protected function _getController(): Controller
} catch (Throwable $e) {
Log::warning(
"Failed to construct or call startup() on the resolved controller class of `$class`. " .
"Using Fallback Controller instead. Error {$e->getMessage()}",
"Using Fallback Controller instead. Error {$e->getMessage()}" .
"\nStack Trace\n: {$e->getTraceAsString()}",
'cake.error'
);
$controller = null;
Expand Down Expand Up @@ -420,7 +421,8 @@ protected function _outputMessage(string $template): Response
return $this->_shutdown();
} catch (MissingTemplateException $e) {
Log::warning(
"MissingTemplateException - Failed to render error template `{$template}`. Error: {$e->getMessage()}",
"MissingTemplateException - Failed to render error template `{$template}` . Error: {$e->getMessage()}" .
"\nStack Trace\n: {$e->getTraceAsString()}",
'cake.error'
);
$attributes = $e->getAttributes();
Expand All @@ -434,7 +436,8 @@ protected function _outputMessage(string $template): Response
return $this->_outputMessage('error500');
} catch (MissingPluginException $e) {
Log::warning(
"MissingPluginException - Failed to render error template `{$template}`. Error: {$e->getMessage()}",
"MissingPluginException - Failed to render error template `{$template}`. Error: {$e->getMessage()}" .
"\nStack Trace\n: {$e->getTraceAsString()}",
'cake.error'
);
$attributes = $e->getAttributes();
Expand All @@ -445,7 +448,8 @@ protected function _outputMessage(string $template): Response
return $this->_outputMessageSafe('error500');
} catch (Throwable $outer) {
Log::warning(
"Throwable - Failed to render error template `{$template}`. Error: {$outer->getMessage()}",
"Throwable - Failed to render error template `{$template}`. Error: {$outer->getMessage()}" .
"\nStack Trace\n: {$outer->getTraceAsString()}",
'cake.error'
);
try {
Expand Down

0 comments on commit 8f56e52

Please sign in to comment.