-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement of Exception info in File manipulation. #19558
Conversation
Improvement of Exception through. Not tested. I do not have the mead. Signed-off-by: Denis Germa <denis.germa@free.fr>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍 It's a good idea to add more details to those exceptions. But the current state adds more confusion from my pov.
@@ -55,7 +55,7 @@ public function getContent() { | |||
*/ | |||
return $this->view->file_get_contents($this->path); | |||
} else { | |||
throw new NotPermittedException(); | |||
throw new NotPermittedException('Permission issue unable to get content of file ' . $this->path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Permission issue unable to get content of file
I don't think so. We don't have permission to read the file.
@@ -74,7 +74,7 @@ public function putContent($data) { | |||
$this->fileInfo = null; | |||
$this->sendHooks(array('postWrite')); | |||
} else { | |||
throw new NotPermittedException(); | |||
throw new NotPermittedException('Permission issue unable to get content of file ' . $this->path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have permission to update a file here. Unable to get content of file is not correct.
@@ -115,7 +115,7 @@ public function fopen($mode) { | |||
$this->sendHooks($postHooks); | |||
return $result; | |||
} else { | |||
throw new NotPermittedException(); | |||
throw new NotPermittedException('Permission issue Could not open (Incorrect mode ' . $mode . ') ' . $this->path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mode is not incorrect. We don't have the required permissions to do that operation. Example: w+ requires us to have read and update permission for a file.
Base repository was deleted. And there was no feedback since a while. Thus I will close this PR for now. It can be picked up later of course. |
Improvement of Exception through.
Not tested. I do not have the mean.
I did this to help debug an issue with nextcloud/Music application.
It hanged while scanning files.
Signed-off-by: Denis Germa denis.germa@free.fr