Skip to content

Modernize the error handler - #32565

Merged
ChristophWurst merged 2 commits into
masterfrom
chore/modernize-error-handler
Nov 3, 2022
Merged

Modernize the error handler#32565
ChristophWurst merged 2 commits into
masterfrom
chore/modernize-error-handler

Conversation

@ChristophWurst

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

/backport 96a91cb to stable24

Comment threadlib/base.php Outdated
Comment threadlib/private/Log/ErrorHandler.php Outdated
Comment threadlib/private/Log/ErrorHandler.php Outdated
CarlSchwan
CarlSchwan previously approved these changes May 24, 2022

@CarlSchwanCarlSchwan left a comment

Copy link
Copy Markdown
Member

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

@ChristophWurstChristophWurst 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
ChristophWurstforce-pushed the chore/modernize-error-handler branch from 1992a60 to 5d20c7dCompareMay 24, 2022 11:33
@ChristophWurst

Copy link
Copy Markdown
MemberAuthor

Tests fail

@ChristophWurstChristophWurst 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
@ChristophWurstChristophWurst added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 9, 2022
@ChristophWurst

Copy link
Copy Markdown
MemberAuthor

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

Comment threadlib/private/Log/ErrorHandler.php
Comment threadlib/private/Log/ErrorHandler.php
This was referenced Aug 12, 2022
@blizzzblizzz mentioned this pull request Aug 24, 2022
@blizzzblizzz mentioned this pull request Aug 30, 2022
@ChristophWurst
ChristophWurstforce-pushed the chore/modernize-error-handler branch from 66509ba to 3e66fabCompareAugust 31, 2022 12:21

@come-nccome-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Comment threadlib/base.php Outdated
This was referenced Sep 6, 2022
@skjnldsvskjnldsv mentioned this pull request Sep 15, 2022
This was referenced Sep 20, 2022
@blizzzblizzz modified the milestones: Nextcloud 25, Nextcloud 26Sep 22, 2022
@ChristophWurst
ChristophWurst requested review from chiris90 and come-nc and removed request for chiris90October 31, 2022 13:53
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@ChristophWurst
ChristophWurstforce-pushed the chore/modernize-error-handler branch from 47fd91b to 4c8ec6dCompareNovember 2, 2022 08:49
@come-nc

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
MemberAuthor

@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 masterNov 3, 2022
@ChristophWurst
ChristophWurst deleted the chore/modernize-error-handler branch November 3, 2022 13:42
@backportbot-nextcloud

Copy link
Copy Markdown

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

@ChristophWurst

Copy link
Copy Markdown
MemberAuthor

/backport 4c8ec6d to stable25

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewstechnical debt🧱 🤔🚀

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants

@ChristophWurst@come-nc@st3iny@chiris90@CarlSchwan@blizzz@skjnldsv