-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35389 from owncloud/add-new-exception-objstorage-…
…stable10 [stable10] Backport of Add new exceptions for objectstore
- Loading branch information
Showing
3 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* @author Sujith Haridasan <sharidasan@owncloud.com> | ||
* | ||
* @copyright Copyright (c) 2019, ownCloud GmbH | ||
* @license AGPL-3.0 | ||
* | ||
* This code is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License, version 3, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License, version 3, | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
namespace OCP\Files\ObjectStore; | ||
|
||
/** | ||
* Exception to handle object storage failures | ||
* Class ObjectStoreException | ||
* | ||
* @package OCP\Files\ObjectStore | ||
* @since 10.3.0 | ||
*/ | ||
class ObjectStoreException extends \Exception { | ||
/** | ||
* ObjectStoreException constructor. | ||
* | ||
* @param string $message | ||
* @param int $code | ||
* @param \Exception|null $previous | ||
* @since 10.3.0 | ||
*/ | ||
public function __construct($message = "", $code = 0, \Exception $previous = null) { | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
lib/public/Files/ObjectStore/ObjectStoreOperationException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* @author Sujith Haridasan <sharidasan@owncloud.com> | ||
* | ||
* @copyright Copyright (c) 2019, ownCloud GmbH | ||
* @license AGPL-3.0 | ||
* | ||
* This code is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License, version 3, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License, version 3, | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
namespace OCP\Files\ObjectStore; | ||
|
||
/** | ||
* Exception to handle read, write and delete to object storage | ||
* Class ObjectStoreOperationException | ||
* | ||
* @package OCP\Files\ObjectStore | ||
* @since 10.3.0 | ||
*/ | ||
class ObjectStoreOperationException extends ObjectStoreException { | ||
/** | ||
* ObjectStoreOperationException constructor. | ||
* | ||
* @param string $message | ||
* @param int $statusCode | ||
* @param int $code | ||
* @param \Exception|null $previous | ||
* @since 10.3.0 | ||
*/ | ||
public function __construct($message = "", $code = 0, \Exception $previous = null) { | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
lib/public/Files/ObjectStore/ObjectStoreWriteException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* @author Sujith Haridasan <sharidasan@owncloud.com> | ||
* | ||
* @copyright Copyright (c) 2019, ownCloud GmbH | ||
* @license AGPL-3.0 | ||
* | ||
* This code is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License, version 3, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License, version 3, | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
namespace OCP\Files\ObjectStore; | ||
|
||
/** | ||
* Exception when file upload to object store fails | ||
* Class ObjectStoreWriteException | ||
* | ||
* @package OCP\Files\ObjectStore | ||
* @since 10.3.0 | ||
*/ | ||
class ObjectStoreWriteException extends ObjectStoreOperationException { | ||
/** @var int */ | ||
private $statusCode; | ||
|
||
/** | ||
* ObjectStoreWriteException constructor. | ||
* | ||
* @param string $message | ||
* @param int $code | ||
* @param \Exception|null $previous | ||
* @since 10.3.0 | ||
*/ | ||
public function __construct($message = "", $code = 0, \Exception $previous = null) { | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |