-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
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))); |
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.
is this required if we remove the two last "catch"?
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.
hum ok, for cleanup
$this->fail(sprintf('Expected IOException to be thrown, got %s instead.', get_class($e))); | ||
} | ||
|
||
if (null !== $wrongMessage) { |
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.
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) { |
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.
is this possible at all? to me it shouldn't
Thank you @xabbuh. |
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()