throw exception if we don't find a token for a given server
This commit is contained in:
parent
cc397da1be
commit
835e70dbe2
1 changed files with 6 additions and 0 deletions
|
@ -156,6 +156,7 @@ class DbHandler {
|
|||
*
|
||||
* @param string $url
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getToken($url) {
|
||||
$hash = $this->hash($url);
|
||||
|
@ -165,6 +166,11 @@ class DbHandler {
|
|||
->setParameter('url_hash', $hash);
|
||||
|
||||
$result = $query->execute()->fetch();
|
||||
|
||||
if (!isset($result['token'])) {
|
||||
throw new \Exception('No token found for: ' . $url);
|
||||
}
|
||||
|
||||
return $result['token'];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue