diff --git a/lib/Providers/Time/HttpTimeProvider.php b/lib/Providers/Time/HttpTimeProvider.php index 8e7806e..1f98f57 100644 --- a/lib/Providers/Time/HttpTimeProvider.php +++ b/lib/Providers/Time/HttpTimeProvider.php @@ -45,10 +45,10 @@ class HttpTimeProvider implements ITimeProvider if (strcasecmp(substr($h, 0, 5), 'Date:') === 0) return \DateTime::createFromFormat($this->expectedtimeformat, trim(substr($h,5)))->getTimestamp(); } - throw new \TimeException(sprintf('Unable to retrieve time from %s (Invalid or no "Date:" header found)', $this->url)); - } - catch (Exception $ex) { - throw new \TimeException(sprintf('Unable to retrieve time from %s (%s)', $this->url, $ex->getMessage())); + throw new \Exception('Invalid or no "Date:" header found'); + } catch (\Exception $ex) { + throw new TimeException(sprintf('Unable to retrieve time from %s (%s)', $this->url, $ex->getMessage())); } + } -} \ No newline at end of file +} diff --git a/lib/Providers/Time/TimeException.php b/lib/Providers/Time/TimeException.php index 8de544d..c5a06e2 100644 --- a/lib/Providers/Time/TimeException.php +++ b/lib/Providers/Time/TimeException.php @@ -1,5 +1,7 @@