mirror of
https://github.com/friendica/friendica
synced 2025-04-23 13:50:11 +00:00
Fix Storage Exceptions
This commit is contained in:
parent
29c7552df5
commit
90c99520bb
6 changed files with 46 additions and 35 deletions
|
@ -57,7 +57,11 @@ class Database implements ISelectableStorage
|
|||
|
||||
return $result['data'];
|
||||
} catch (Exception $exception) {
|
||||
throw new StorageException(sprintf('Database storage failed to get %s', $reference), $exception->getCode(), $exception);
|
||||
if ($exception instanceof ReferenceStorageException) {
|
||||
throw $exception;
|
||||
} else {
|
||||
throw new StorageException(sprintf('Database storage failed to get %s', $reference), $exception->getCode(), $exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,7 +105,11 @@ class Database implements ISelectableStorage
|
|||
throw new ReferenceStorageException(sprintf('Database storage failed to delete %s', $reference));
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
throw new StorageException(sprintf('Database storage failed to delete %s', $reference), $exception->getCode(), $exception);
|
||||
if ($exception instanceof ReferenceStorageException) {
|
||||
throw $exception;
|
||||
} else {
|
||||
throw new StorageException(sprintf('Database storage failed to delete %s', $reference), $exception->getCode(), $exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue