Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Improvement of Exception info in File manipulation. #19558

wants to merge 1 commit into from

Conversation

dgedgedge
Copy link

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

Improvement of Exception through.
Not tested. I do not have the mead.

Signed-off-by: Denis Germa <denis.germa@free.fr>
@dgedgedge dgedgedge mentioned this pull request Feb 20, 2020
@dgedgedge dgedgedge changed the title Update File.php Improvement of Exception info in File manipulation. Feb 21, 2020
@gary-kim gary-kim added 3. to review Waiting for reviews enhancement labels Feb 22, 2020
@gary-kim gary-kim added this to the Nextcloud 19 milestone Feb 22, 2020
@rullzer rullzer mentioned this pull request Apr 4, 2020
80 tasks
Copy link
Contributor

@kesselb kesselb left a 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);
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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.

This was referenced Apr 9, 2020
@rullzer rullzer mentioned this pull request Apr 23, 2020
11 tasks
@rullzer rullzer removed this from the Nextcloud 19 milestone Apr 30, 2020
@MorrisJobke
Copy link
Member

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.

@MorrisJobke MorrisJobke closed this Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants