diff --git a/CRM/Extension/Browser.php b/CRM/Extension/Browser.php index cf6dcae9d354..56ce614a9c6a 100644 --- a/CRM/Extension/Browser.php +++ b/CRM/Extension/Browser.php @@ -224,7 +224,9 @@ private function grabRemoteJson() { catch (GuzzleException $e) { throw new CRM_Extension_Exception(ts('The CiviCRM public extensions directory at %1 could not be contacted - please check your webserver can make external HTTP requests', [1 => $this->getRepositoryUrl()]), 'connection_error'); } - restore_error_handler(); + finally { + restore_error_handler(); + } if ($response->getStatusCode() !== 200) { throw new CRM_Extension_Exception(ts('The CiviCRM public extensions directory at %1 could not be contacted - please check your webserver can make external HTTP requests', [1 => $this->getRepositoryUrl()]), 'connection_error');