Skip to content

Commit bfa494f

Browse files
Merge pull request #52800 from nextcloud/debt/noid/simple-file-generic-exception
2 parents 7523c38 + 866063c commit bfa494f

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

lib/private/Files/SimpleFS/SimpleFile.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
namespace OC\Files\SimpleFS;
77

88
use OCP\Files\File;
9+
use OCP\Files\GenericFileException;
910
use OCP\Files\NotFoundException;
1011
use OCP\Files\NotPermittedException;
1112
use OCP\Files\SimpleFS\ISimpleFile;
13+
use OCP\Lock\LockedException;
1214

1315
class SimpleFile implements ISimpleFile {
1416
private File $file;
@@ -48,8 +50,10 @@ public function getMTime(): int {
4850
/**
4951
* Get the content
5052
*
51-
* @throws NotPermittedException
53+
* @throws GenericFileException
54+
* @throws LockedException
5255
* @throws NotFoundException
56+
* @throws NotPermittedException
5357
*/
5458
public function getContent(): string {
5559
$result = $this->file->getContent();
@@ -65,8 +69,10 @@ public function getContent(): string {
6569
* Overwrite the file
6670
*
6771
* @param string|resource $data
68-
* @throws NotPermittedException
72+
* @throws GenericFileException
73+
* @throws LockedException
6974
* @throws NotFoundException
75+
* @throws NotPermittedException
7076
*/
7177
public function putContent($data): void {
7278
try {

lib/public/Files/SimpleFS/ISimpleFile.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
*/
66
namespace OCP\Files\SimpleFS;
77

8+
use OCP\Files\GenericFileException;
89
use OCP\Files\NotFoundException;
910
use OCP\Files\NotPermittedException;
11+
use OCP\Lock\LockedException;
1012

1113
/**
1214
* This interface allows to manage simple files.
@@ -49,8 +51,10 @@ public function getMTime(): int;
4951
/**
5052
* Get the content
5153
*
52-
* @throws NotPermittedException
54+
* @throws GenericFileException
55+
* @throws LockedException
5356
* @throws NotFoundException
57+
* @throws NotPermittedException
5458
* @since 11.0.0
5559
*/
5660
public function getContent(): string;
@@ -59,8 +63,10 @@ public function getContent(): string;
5963
* Overwrite the file
6064
*
6165
* @param string|resource $data
62-
* @throws NotPermittedException
66+
* @throws GenericFileException
67+
* @throws LockedException
6368
* @throws NotFoundException
69+
* @throws NotPermittedException
6470
* @since 11.0.0
6571
*/
6672
public function putContent($data): void;

0 commit comments

Comments
 (0)