diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/ImageController.php | 3 | ||||
-rw-r--r-- | lib/UploadException.php | 27 |
2 files changed, 29 insertions, 1 deletions
diff --git a/lib/Controller/ImageController.php b/lib/Controller/ImageController.php index 54a10336d..200119cd4 100644 --- a/lib/Controller/ImageController.php +++ b/lib/Controller/ImageController.php @@ -27,6 +27,7 @@ namespace OCA\Text\Controller; use Exception; use OCA\Text\Service\SessionService; +use OCA\Text\UploadException; use OCP\AppFramework\Http; use OCA\Text\Service\ImageService; use OCP\AppFramework\Controller; @@ -218,7 +219,7 @@ class ImageController extends Controller { $error = $phpFileUploadErrors[$file['error']]; } if ($error !== null) { - throw new Exception($error); + throw new UploadException($error); } return $file; } diff --git a/lib/UploadException.php b/lib/UploadException.php new file mode 100644 index 000000000..99ec93201 --- /dev/null +++ b/lib/UploadException.php @@ -0,0 +1,27 @@ +<?php +/** + * @copyright Copyright (c) 2021 Julien Veyssier <eneiluj@posteo.net> + * + * @author Julien Veyssier <eneiluj@posteo.net> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * 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 + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCA\Text; + +class UploadException extends \Exception { +} |