aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-05-16 14:56:46 +0200
committerprovokateurin <kate@provokateurin.de>2024-05-16 15:17:10 +0200
commita8abe9d3c231d0f77b8b5f6f81469caa89011a49 (patch)
tree67543968bbfb202f5b58f3e4a1583ca0d4c8f96a /core/Controller
parent4c375c98a464c382c5a019d4716c88fce33b9ffc (diff)
downloadnextcloud-server-a8abe9d3c231d0f77b8b5f6f81469caa89011a49.tar.gz
nextcloud-server-a8abe9d3c231d0f77b8b5f6f81469caa89011a49.zip
fix(TaskProcessingApi): Cleanup error handling
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/TaskProcessingApiController.php12
1 files changed, 2 insertions, 10 deletions
diff --git a/core/Controller/TaskProcessingApiController.php b/core/Controller/TaskProcessingApiController.php
index 00551b5d3e2..9783299bccb 100644
--- a/core/Controller/TaskProcessingApiController.php
+++ b/core/Controller/TaskProcessingApiController.php
@@ -35,14 +35,10 @@ use OCP\AppFramework\Http\Attribute\PublicPage;
use OCP\AppFramework\Http\Attribute\UserRateLimit;
use OCP\AppFramework\Http\DataDownloadResponse;
use OCP\AppFramework\Http\DataResponse;
-use OCP\Common\Exception\NotFoundException;
use OCP\Files\File;
-use OCP\Files\GenericFileException;
use OCP\Files\IRootFolder;
-use OCP\Files\NotPermittedException;
use OCP\IL10N;
use OCP\IRequest;
-use OCP\Lock\LockedException;
use OCP\TaskProcessing\EShapeType;
use OCP\TaskProcessing\Exception\Exception;
use OCP\TaskProcessing\Exception\UnauthorizedException;
@@ -164,7 +160,7 @@ class TaskProcessingApiController extends \OCP\AppFramework\OCSController {
return new DataResponse([
'task' => $json,
]);
- } catch (NotFoundException $e) {
+ } catch (\OCP\TaskProcessing\Exception\NotFoundException $e) {
return new DataResponse(['message' => $this->l->t('Task not found')], Http::STATUS_NOT_FOUND);
} catch (\RuntimeException $e) {
return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR);
@@ -221,8 +217,6 @@ class TaskProcessingApiController extends \OCP\AppFramework\OCSController {
]);
} catch (Exception $e) {
return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR);
- } catch (\JsonException $e) {
- return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
@@ -250,8 +244,6 @@ class TaskProcessingApiController extends \OCP\AppFramework\OCSController {
]);
} catch (Exception $e) {
return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR);
- } catch (\JsonException $e) {
- return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
@@ -287,7 +279,7 @@ class TaskProcessingApiController extends \OCP\AppFramework\OCSController {
return new Http\DataDownloadResponse($node->getContent(), $node->getName(), $node->getMimeType());
} catch (\OCP\TaskProcessing\Exception\NotFoundException $e) {
return new DataResponse(['message' => $this->l->t('Not found')], Http::STATUS_NOT_FOUND);
- } catch (GenericFileException|NotPermittedException|LockedException|Exception $e) {
+ } catch (Exception $e) {
return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR);
}
}