Jun 20, 2017
0
Level 33
Try-Catch not stopping cURL error 60: SSL certificate problem: Invalid certificate chain exception
I am getting an exception in our uptime monitor that is breaking the monitor rather than returning a "false" to trigger a notification and a 'red light' in our dashboard.
I THOUGHT I would handle the exception with the code below but it is not working
public function fetch($path)
{
try {
$response = $this->client->get($path, ['http_errors' => false]);
return $response->getStatusCode();
} catch (\GuzzleHttp\Exception\ConnectException $e) {
Log::error('Received error: ' . $e->getMessage());
return false;
} catch (Exception $e) {
Log::error('Received error: ' . $e->getMessage());
return false;
}
} // end function
Any thoughts?
Please or to participate in this conversation.