Skip to content

Commit

Permalink
Improvising the usage of logger method to log exception with correct …
Browse files Browse the repository at this point in the history
…message.
  • Loading branch information
apathak18 committed Jul 15, 2024
1 parent 120a77d commit ede7e98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function invalidatePath(string $path, array $sites): void {
}
catch (RequestException $exception) {
// Using logger service to log the exception.
$this->logger->error($exception);
$this->logger->error($exception->getMessage());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/next/src/NextSettingsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getSitePreviewer(): ?SitePreviewerInterface {
return $site_previewer;
}
catch (PluginException $exception) {
$this->logger->error($exception);
$this->logger->error($exception->getMessage());

return NULL;
}
Expand All @@ -116,7 +116,7 @@ public function getPreviewUrlGenerator(): ?PreviewUrlGeneratorInterface {
return $preview_url_generator;
}
catch (PluginException $exception) {
$this->logger->error($exception);
$this->logger->error($exception->getMessage());

return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/next/src/Plugin/Next/Revalidator/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function revalidate(EntityActionEvent $event): bool {
}
}
catch (\Exception $exception) {
$this->logger->error($exception);
$this->logger->error($exception->getMessage());
$revalidated = FALSE;
}
}
Expand Down

0 comments on commit ede7e98

Please sign in to comment.