Skip to content
Snippets Groups Projects
Commit bd8b3f52 authored by Lukas Reschke's avatar Lukas Reschke Committed by GitHub
Browse files

Merge pull request #1830 from nextcloud/downstream-26250

Improved exception messages
parents 24786d5c 169faf8c
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,7 @@ class Avatar implements IAvatar {
}
if (!($img->height() === $img->width())) {
throw new NotSquareException();
throw new NotSquareException($this->l->t("Avatar image is not square"));
}
$this->remove();
......
......@@ -42,7 +42,7 @@ class Folder extends Node implements \OCP\Files\Folder {
*/
public function getFullPath($path) {
if (!$this->isValidPath($path)) {
throw new NotPermittedException();
throw new NotPermittedException('Invalid path');
}
return $this->path . $this->normalizePath($path);
}
......@@ -152,7 +152,7 @@ class Folder extends Node implements \OCP\Files\Folder {
$this->root->emit('\OC\Files', 'postCreate', array($node));
return $node;
} else {
throw new NotPermittedException();
throw new NotPermittedException('No create permission for folder');
}
}
......@@ -173,7 +173,7 @@ class Folder extends Node implements \OCP\Files\Folder {
$this->root->emit('\OC\Files', 'postCreate', array($node));
return $node;
} else {
throw new NotPermittedException();
throw new NotPermittedException('No create permission for path');
}
}
......@@ -321,7 +321,7 @@ class Folder extends Node implements \OCP\Files\Folder {
$this->root->emit('\OC\Files', 'postDelete', array($nonExisting));
$this->exists = false;
} else {
throw new NotPermittedException();
throw new NotPermittedException('No delete permission for path');
}
}
......@@ -343,7 +343,7 @@ class Folder extends Node implements \OCP\Files\Folder {
$this->root->emit('\OC\Files', 'postWrite', array($targetNode));
return $targetNode;
} else {
throw new NotPermittedException();
throw new NotPermittedException('No permission to copy to path');
}
}
......@@ -366,7 +366,7 @@ class Folder extends Node implements \OCP\Files\Folder {
$this->path = $targetPath;
return $targetNode;
} else {
throw new NotPermittedException();
throw new NotPermittedException('No permission to move to path');
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment