Skip to content

Commit

Permalink
Merge pull request #35389 from owncloud/add-new-exception-objstorage-…
Browse files Browse the repository at this point in the history
…stable10

[stable10] Backport of Add new exceptions for objectstore
  • Loading branch information
micbar authored May 31, 2019
2 parents ff5522a + 496de13 commit 7b2016f
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 0 deletions.
43 changes: 43 additions & 0 deletions lib/public/Files/ObjectStore/ObjectStoreException.php
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 lib/public/Files/ObjectStore/ObjectStoreOperationException.php
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 lib/public/Files/ObjectStore/ObjectStoreWriteException.php
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);
}
}

0 comments on commit 7b2016f

Please sign in to comment.