8000 [Filesystem] improve error handling in lock() by xabbuh · Pull Request #22910 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Filesystem] improve error handling in lock() #22910

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

Merged
merged 1 commit into from
May 28, 2017

Conversation

xabbuh
Copy link
Member
@xabbuh xabbuh commented May 25, 2017
Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #22882
License MIT
Doc PR

}

if (!$e instanceof IOException) {
$this->fail(sprintf('Expected IOException to be thrown, got %s instead.', get_class($e)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this required if we remove the two last "catch"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hum ok, for cleanup

$this->fail(sprintf('Expected IOException to be thrown, got %s instead.', get_class($e)));
}

if (null !== $wrongMessage) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertNull?

@@ -82,8 +86,12 @@ public function lock($blocking = false)
restore_error_handler();

if (!$this->handle) {
$error = error_get_last();
throw new IOException($error['message'], 0, null, $this->file);
if (null === $error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this possible at all? to me it shouldn't

@nicolas-grekas
Copy link
Member

Thank you @xabbuh.

@nicolas-grekas nicolas-grekas merged commit 25381a2 into symfony:2.7 May 28, 2017
nicolas-grekas added a commit that referenced this pull request May 28, 2017
This PR was merged into the 2.7 branch.

Discussion
----------

[Filesystem] improve error handling in lock()

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22882
| License       | MIT
| Doc PR        |

Commits
-------

25381a2 [Filesystem] improve error handling in lock()
@xabbuh xabbuh deleted the issue-22882 branch May 28, 2017 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0