Skip to content

Commit df74a59

Browse files
committed
🐛 fix unthrowable exception
1 parent 3640fee commit df74a59

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/Providers/Time/HttpTimeProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public function getTime() {
4545
if (strcasecmp(substr($h, 0, 5), 'Date:') === 0)
4646
return \DateTime::createFromFormat($this->expectedtimeformat, trim(substr($h,5)))->getTimestamp();
4747
}
48-
throw new \TimeException(sprintf('Unable to retrieve time from %s (Invalid or no "Date:" header found)', $this->url));
49-
}
50-
catch (Exception $ex) {
51-
throw new \TimeException(sprintf('Unable to retrieve time from %s (%s)', $this->url, $ex->getMessage()));
48+
throw new \Exception('Invalid or no "Date:" header found');
49+
} catch (\Exception $ex) {
50+
throw new TimeException(sprintf('Unable to retrieve time from %s (%s)', $this->url, $ex->getMessage()));
5251
}
52+
5353
}
54-
}
54+
}

lib/Providers/Time/TimeException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace RobThree\Auth\Providers\Time;
4+
35
use RobThree\Auth\TwoFactorAuthException;
46

5-
class TimeException extends TwoFactorAuthException {}
7+
class TimeException extends TwoFactorAuthException {}

0 commit comments

Comments
 (0)