Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCH-5237: Outputting information about exception. #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jose-oliveira
Copy link
Contributor

No description provided.

@@ -47,14 +47,16 @@ protected function execute(InputInterface $input, OutputInterface $output) {
}
// @TODO: This needs to be fixed. The 'https' is not present in the URL.
if (strpos($url, 'https') !== 0) {
$output->writeln("<warning>This site does not have an SSL Certificate.</warning>");
$output->writeln("<warning>This site does not have an SSL Certificate or isn't publicly accessible.</warning>");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this message Site isn't publicly accessible should be added inside catch because this condition just checks if site url contains https or not.

@@ -47,14 +47,16 @@ protected function execute(InputInterface $input, OutputInterface $output) {
}
// @TODO: This needs to be fixed. The 'https' is not present in the URL.
if (strpos($url, 'https') !== 0) {
$output->writeln("<warning>This site does not have an SSL Certificate.</warning>");
$output->writeln("<warning>This site does not have an SSL Certificate or isn't publicly accessible.</warning>");
return 0;
}
try {
$cert = $this->getCertByHostname($url);
}
catch (\Exception $e) {
$output->writeln("<warning>Something went wrong getting the SSL cert of $url</warning>");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$output->writeln("<warning>Something went wrong getting the SSL cert of $url</warning>");
$output->writeln("<warning>Something went wrong getting the SSL cert of $url or it's not publicly accessible.</warning>");

Copy link
Contributor

@amangrover90 amangrover90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a minor comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants