diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2021-01-02 17:57:17 +0100 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2021-02-13 13:22:57 +0100 |
commit | b4fa772bc5f23f84fc292f5d6bf884543d2bfe51 (patch) | |
tree | 8576ad3ea145f3644804e2fd93de462cfc2c2578 /lib/Service/Exceptions/ServiceConflictException.php | |
parent | ceba81060303e49b2617397397f2804516052ec9 (diff) |
Remove V1 item API
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Service/Exceptions/ServiceConflictException.php')
-rw-r--r-- | lib/Service/Exceptions/ServiceConflictException.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/Service/Exceptions/ServiceConflictException.php b/lib/Service/Exceptions/ServiceConflictException.php index dd6ba03c9..ed3d3a54c 100644 --- a/lib/Service/Exceptions/ServiceConflictException.php +++ b/lib/Service/Exceptions/ServiceConflictException.php @@ -13,16 +13,22 @@ namespace OCA\News\Service\Exceptions; +use Exception; +use OCP\AppFramework\Db\IMapperException; + +/** + * Class ServiceConflictException + * + * @package OCA\News\Service\Exceptions + */ class ServiceConflictException extends ServiceException { /** - * Constructor - * - * @param string $msg the error message + * @inheritDoc */ - public function __construct(string $msg) + public static function from(IMapperException $exception): ServiceException { - parent::__construct($msg); + return new self($exception->getMessage(), $exception->getCode(), $exception); } } |