mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-17 18:55:48 +00:00
Merge branch 'fix-unthrowable-exception'
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace RobThree\Auth\Providers\Time;
|
||||
|
||||
use RobThree\Auth\TwoFactorAuthException;
|
||||
|
||||
class TimeException extends TwoFactorAuthException {}
|
||||
class TimeException extends TwoFactorAuthException {}
|
||||
|
||||
Reference in New Issue
Block a user