summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-08-06 16:37:51 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-08-06 16:37:51 -0400
commit1b21cde2b3c10b8a4756325039745f1ea9024769 (patch)
treee71e75a197a8a78f03b4279b7f62e704b07ab40f /lib/public
parent3be4f5f2f18c28720022dcfad76ac9560ad1fa39 (diff)
downloadnextcloud-server-1b21cde2b3c10b8a4756325039745f1ea9024769.tar.gz
nextcloud-server-1b21cde2b3c10b8a4756325039745f1ea9024769.zip
Throw more exceptions
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/share.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index f71b5089786..df5ad82d7fd 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -631,14 +631,16 @@ class Share {
$fileSource = $checkReshare['file_source'];
$fileTarget = $checkReshare['file_target'];
} else {
- \OC_Log::write('OCP\Share', 'Sharing '.$itemSource.' failed, because resharing is not allowed', \OC_Log::ERROR);
- return false;
+ $message = 'Sharing '.$itemSource.' failed, because resharing is not allowed';
+ \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+ throw new \Exception($message);
}
} else {
$parent = null;
if (!$backend->isValidSource($itemSource, $uidOwner)) {
- \OC_Log::write('OCP\Share', 'Sharing '.$itemSource.' failed, because the sharing backend for '.$itemType.' could not find its source', \OC_Log::ERROR);
- return false;
+ $message = 'Sharing '.$itemSource.' failed, because the sharing backend for '.$itemType.' could not find its source';
+ \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+ throw new \Exception($message);
}
$parent = null;
if ($backend instanceof Share_Backend_File_Dependent) {
@@ -646,8 +648,9 @@ class Share {
$filePath = $backend->getFilePath($itemSource, $uidOwner);
$fileSource = \OC_FileCache::getId($filePath);
if ($fileSource == -1) {
- \OC_Log::write('OCP\Share', 'Sharing '.$itemSource.' failed, because the file could not be found in the file cache', \OC_Log::ERROR);
- return false;
+ $message = 'Sharing '.$itemSource.' failed, because the file could not be found in the file cache';
+ \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+ throw new \Exception($message);
}
} else {
$fileSource = null;