1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 11:14:04 +00:00

Better error handling (fix #5)

This commit is contained in:
Samuel Štancl 2019-01-20 19:47:56 +01:00
parent 7ac9a4ab2c
commit ac34d0e5b8

View file

@ -55,7 +55,12 @@ class RedisStorageDriver implements StorageDriver
public function deleteTenant(string $id): bool
{
$domain = $this->getTenantById($id)['domain'];
try {
$domain = $this->getTenantById($id)['domain'];
} catch (\Throwable $th) {
throw new \Exception("No tenant with UUID $id exists.");
}
$this->redis->del("domains:$domain");
return (bool) $this->redis->del("tenants:$id");
}