-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
} | ||
} | ||
|
||
|
@@ -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 commentThe 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 commentThe 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. |
||
} | ||
} | ||
|
||
|
@@ -134,7 +134,7 @@ public function delete() { | |
$this->exists = false; | ||
$this->fileInfo = null; | ||
} else { | ||
throw new NotPermittedException(); | ||
throw new NotPermittedException('Permission issue Could not delete 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.
I don't think so. We don't have permission to read the file.