diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-02 14:07:11 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-02 14:07:11 +0100 |
commit | 4d7130ad315637b7b7b925efce4032472f4530f8 (patch) | |
tree | 67109fe0af7bf51172e08ea88df2f9f9fd449744 /lib | |
parent | ce053b980860070957bedb13e6fcd9d45fe50b9b (diff) | |
download | nextcloud-server-4d7130ad315637b7b7b925efce4032472f4530f8.tar.gz nextcloud-server-4d7130ad315637b7b7b925efce4032472f4530f8.zip |
[Share 2.0] Add exceptions to OCP
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/share20/defaultshareprovider.php | 2 | ||||
-rw-r--r-- | lib/private/share20/manager.php | 2 | ||||
-rw-r--r-- | lib/public/share/exceptions/genericshareexception.php | 28 | ||||
-rw-r--r-- | lib/public/share/exceptions/sharenotfound.php (renamed from lib/private/share20/exception/sharenotfound.php) | 11 |
4 files changed, 39 insertions, 4 deletions
diff --git a/lib/private/share20/defaultshareprovider.php b/lib/private/share20/defaultshareprovider.php index 224dddf4019..7b78be2b61d 100644 --- a/lib/private/share20/defaultshareprovider.php +++ b/lib/private/share20/defaultshareprovider.php @@ -24,7 +24,7 @@ use OCP\Files\File; use OCP\Share\IShareProvider; use OC\Share20\Exception\InvalidShare; use OC\Share20\Exception\ProviderException; -use OC\Share20\Exception\ShareNotFound; +use OCP\Share\Exceptions\ShareNotFound; use OC\Share20\Exception\BackendError; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Files\NotFoundException; diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php index b22b81bb404..8ea9d10c1cb 100644 --- a/lib/private/share20/manager.php +++ b/lib/private/share20/manager.php @@ -36,7 +36,7 @@ use OCP\Files\File; use OCP\Files\Folder; use OCP\IUser; -use OC\Share20\Exception\ShareNotFound; +use OCP\Share\Exceptions\ShareNotFound; use OC\HintException; /** diff --git a/lib/public/share/exceptions/genericshareexception.php b/lib/public/share/exceptions/genericshareexception.php new file mode 100644 index 00000000000..83dfa12dbfc --- /dev/null +++ b/lib/public/share/exceptions/genericshareexception.php @@ -0,0 +1,28 @@ +<?php + +namespace OCP\Share\Exceptions; +use OC\HintException; + +/** + * Class GenericEncryptionException + * + * @package OCP\Share\Exceptions + * @since 9.0.0 + */ +class GenericShareException extends HintException { + + /** + * @param string $message + * @param string $hint + * @param int $code + * @param \Exception $previous + * @since 9.0.0 + */ + public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) { + if (empty($message)) { + $message = 'Unspecified share exception'; + } + parent::__construct($message, $hint, $code, $previous); + } + +} diff --git a/lib/private/share20/exception/sharenotfound.php b/lib/public/share/exceptions/sharenotfound.php index b59f185939a..96e7c096492 100644 --- a/lib/private/share20/exception/sharenotfound.php +++ b/lib/public/share/exceptions/sharenotfound.php @@ -18,8 +18,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -namespace OC\Share20\Exception; -class ShareNotFound extends \Exception { +namespace OCP\Share\Exceptions; + +/** + * Class ShareNotFound + * + * @package OCP\Share\Exceptions + * @since 9.0.0 + */ +class ShareNotFound extends GenericShareException { } |