Skip to content

[Filesystem] Fix usages of error_get_last() #27236

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 14, 2018

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented May 11, 2018

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

Same as #27232 for 2.7.
When a userland error handler doesn't return false, error_get_last() is not updated, so we cannot see the real last error, but the previous one.

See https://3v4l.org/Smmt7

@@ -21,6 +21,8 @@
*/
class Filesystem
{
private static $error;
Copy link
Member

Choose a reason for hiding this comment

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

lastError as for Process? sounds more clear to me

Copy link
Member Author

Choose a reason for hiding this comment

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

let's go for $lastError, updated

@fabpot
Copy link
Member

fabpot commented May 14, 2018

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 9d015c7 into symfony:2.7 May 14, 2018
fabpot added a commit that referenced this pull request May 14, 2018
This PR was merged into the 2.7 branch.

Discussion
----------

[Filesystem] Fix usages of error_get_last()

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

Same as #27232 for 2.7.
When a userland error handler doesn't return `false`, `error_get_last()` is not updated, so we cannot see the real last error, but the previous one.

See https://3v4l.org/Smmt7

Commits
-------

9d015c7 [Filesystem] Fix usages of error_get_last()
@nicolas-grekas nicolas-grekas deleted the error-get-last27 branch May 16, 2018 14:51
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.

4 participants