Commit d009e6d6 authored by Vincent Petry's avatar Vincent Petry Committed by GitHub
Browse files

Merge pull request #26250 from shtrom/fix/exception-messages

Fix/exception messages
parents 38a7da99 2a381294
......@@ -120,7 +120,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();
......
......@@ -37,7 +37,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: ' . $path);
}
return $this->path . $this->normalizePath($path);
}
......@@ -147,7 +147,7 @@ class Folder extends Node implements \OCP\Files\Folder {
$this->root->emit('\OC\Files', 'postCreate', [$node]);
return $node;
} else {
throw new NotPermittedException();
throw new NotPermittedException('No create permission for folder ' . $this->getFullPath($path));
}
}
......@@ -168,7 +168,7 @@ class Folder extends Node implements \OCP\Files\Folder {
$this->root->emit('\OC\Files', 'postCreate', [$node]);
return $node;
} else {
throw new NotPermittedException();
throw new NotPermittedException('No create permission for path ' . $this->getFullPath($path));
}
}
......@@ -297,7 +297,7 @@ class Folder extends Node implements \OCP\Files\Folder {
$this->root->emit('\OC\Files', 'postDelete', [$nonExisting]);
$this->exists = false;
} else {
throw new NotPermittedException();
throw new NotPermittedException('No delete permission for path ' . $this->getFullPath($this->path));
}
}
......@@ -319,7 +319,7 @@ class Folder extends Node implements \OCP\Files\Folder {
$this->root->emit('\OC\Files', 'postWrite', [$targetNode]);
return $targetNode;
} else {
throw new NotPermittedException();
throw new NotPermittedException('No permission to copy to path ' . $targetPath);
}
}
......@@ -342,7 +342,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 ' . $targetPath);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment