|
35 | 35 | use OCP\AppFramework\Http\Attribute\UserRateLimit; |
36 | 36 | use OCP\AppFramework\Http\DataDownloadResponse; |
37 | 37 | use OCP\AppFramework\Http\DataResponse; |
38 | | -use OCP\Common\Exception\NotFoundException; |
39 | 38 | use OCP\Files\File; |
40 | 39 | use OCP\Files\GenericFileException; |
41 | 40 | use OCP\Files\IRootFolder; |
@@ -164,7 +163,7 @@ public function getTask(int $id): DataResponse { |
164 | 163 | return new DataResponse([ |
165 | 164 | 'task' => $json, |
166 | 165 | ]); |
167 | | - } catch (NotFoundException $e) { |
| 166 | + } catch (\OCP\TaskProcessing\Exception\NotFoundException $e) { |
168 | 167 | return new DataResponse(['message' => $this->l->t('Task not found')], Http::STATUS_NOT_FOUND); |
169 | 168 | } catch (\RuntimeException $e) { |
170 | 169 | return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR); |
@@ -221,8 +220,6 @@ public function listTasksByApp(string $appId, ?string $customId = null): DataRes |
221 | 220 | ]); |
222 | 221 | } catch (Exception $e) { |
223 | 222 | return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR); |
224 | | - } catch (\JsonException $e) { |
225 | | - return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR); |
226 | 223 | } |
227 | 224 | } |
228 | 225 |
|
@@ -250,8 +247,6 @@ public function listTasks(?string $taskType, ?string $customId = null): DataResp |
250 | 247 | ]); |
251 | 248 | } catch (Exception $e) { |
252 | 249 | return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR); |
253 | | - } catch (\JsonException $e) { |
254 | | - return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR); |
255 | 250 | } |
256 | 251 | } |
257 | 252 |
|
@@ -287,7 +282,7 @@ public function getFileContents(int $taskId, int $fileId): Http\DataDownloadResp |
287 | 282 | return new Http\DataDownloadResponse($node->getContent(), $node->getName(), $node->getMimeType()); |
288 | 283 | } catch (\OCP\TaskProcessing\Exception\NotFoundException $e) { |
289 | 284 | return new DataResponse(['message' => $this->l->t('Not found')], Http::STATUS_NOT_FOUND); |
290 | | - } catch (GenericFileException|NotPermittedException|LockedException|Exception $e) { |
| 285 | + } catch (Exception $e) { |
291 | 286 | return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR); |
292 | 287 | } |
293 | 288 | } |
|
0 commit comments