mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:44:02 +00:00
Better error handling (fix #5)
This commit is contained in:
parent
7ac9a4ab2c
commit
ac34d0e5b8
1 changed files with 6 additions and 1 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue