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 23, 2024
1 parent 120a77d commit c335c18
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
3 changes: 0 additions & 3 deletions modules/next/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
],
"require": {
"drupal/decoupled_router": "^2.0",
"drupal/graphql": "^4.8",
"drupal/graphql_compose": "^2.2",
"drupal/jwt": "^2 || ^3",
"drupal/pathauto": "^1.11",
"drupal/simple_oauth": "^5.0 || ^6.0",
"drupal/subrequests": "^3.0"
Expand Down
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 c335c18

Please sign in to comment.