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

Modernize the error handler #32565

Merged
merged 2 commits into from
Nov 3, 2022
Merged

Conversation

ChristophWurst
Copy link
Member

  • Make it a dynamic class with dynamic methods
  • Make the logger a constructor arg -> it is always available
  • Fix that some deprecations were logged as errors (E_DEPRECATED vs E_USER_DEPRECATED)

@ChristophWurst
Copy link
Member Author

/backport 96a91cb to stable24

lib/base.php Outdated Show resolved Hide resolved
lib/private/Log/ErrorHandler.php Outdated Show resolved Hide resolved
lib/private/Log/ErrorHandler.php Outdated Show resolved Hide resolved
CarlSchwan
CarlSchwan previously approved these changes May 24, 2022
Copy link
Member

@CarlSchwan CarlSchwan left a comment

Choose a reason for hiding this comment

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

Looks good, just need a cs:fix run

@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 24, 2022
@ChristophWurst
Copy link
Member Author

Tests fail

@ChristophWurst ChristophWurst added 2. developing Work in progress and removed 4. to release Ready to be released and/or waiting for tests to finish labels Jun 1, 2022
@ChristophWurst ChristophWurst added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 9, 2022
@ChristophWurst
Copy link
Member Author

I've moved the handler registration outside the constructor to make the class testable.

This was referenced Aug 12, 2022
@blizzz blizzz mentioned this pull request Aug 24, 2022
Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

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

👍

lib/base.php Outdated Show resolved Hide resolved
This was referenced Sep 6, 2022
@skjnldsv skjnldsv mentioned this pull request Sep 15, 2022
This was referenced Sep 20, 2022
@blizzz blizzz modified the milestones: Nextcloud 25, Nextcloud 26 Sep 22, 2022
@ChristophWurst ChristophWurst requested review from chiris90 and come-nc and removed request for chiris90 October 31, 2022 13:53
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@come-nc
Copy link
Contributor

come-nc commented Nov 3, 2022

@ChristophWurst Will tests still fail on deprecation warnings? We have convertDeprecationsToExceptions="true" in the phpunit configuration and it’s quite useful to ensure PHP compatibility.

@ChristophWurst
Copy link
Member Author

@ChristophWurst Will tests still fail on deprecation warnings? We have convertDeprecationsToExceptions="true" in the phpunit configuration and it’s quite useful to ensure PHP compatibility.

Looks like they do

This attribute configures whether E_DEPRECATED and E_USER_DEPRECATED events triggered by the code under test are converted to an exception (and mark the test as error).

@ChristophWurst ChristophWurst merged commit ac92d00 into master Nov 3, 2022
@ChristophWurst ChristophWurst deleted the chore/modernize-error-handler branch November 3, 2022 13:42
@backportbot-nextcloud
Copy link

The backport to stable24 failed. Please do this backport manually.

@ChristophWurst
Copy link
Member Author

/backport 4c8ec6d to stable25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

7 participants