Ref T15554. The plan is to add a new listener that will only listen to DEPRECATED events, and do something useful with them.
Details
- Reviewers
Matthew - Group Reviewers
O1: Blessed Committers - Maniphest Tasks
- T15554: Handling PHP deprecations: convert to Setup Issues
- Commits
- rARC25611ba24add: PhutilErrorHandler: support multiple error listeners
Test script in P26 shows registering 2 handlers and getting both invoked.
Diff Detail
- Repository
- rARC Arcanist
- Lint
Lint Warnings Severity Location Code Message Warning src/error/PhutilErrorHandler.php:457 XHP9 Naming Conventions Warning src/error/PhutilErrorHandler.php:458 XHP9 Naming Conventions - Unit
Tests Passed - Build Status
Buildable 746 Build 746: arc lint + arc unit
Event Timeline
There are, in total, 3 call-sites to setErrorListener - in for the daemons, one for dark-console, and one (PhutilErrorLog) that lives in arcanist but is only used by the SSHD scripts.
Notably, that means the the listener function isn't used when running arc, and probably also in any of the scripts in phorge/bin/.
src/workflow/ArcanistLookWorkflow.php | ||
---|---|---|
57 ↗ | (On Diff #1242) | Probably this is a test in production |
I like renaming the function!
We should probably have a timeline for removing the old function. Do we have a task for that?
src/filesystem/PhutilErrorLog.php | ||
---|---|---|
31 ↗ | (On Diff #1536) | The linter did point out a legitimate concern here, however; this doesn't seem to be your code change. Should we file a new task? |
I agree, but that the alternative is leaving deprecated code around. I think we should probably come up with a formal deprecation plan, but that seems out of the scope here. I'll think on it and write up a task :)
Sorry for the delayed review
src/error/PhutilErrorHandler.php | ||
---|---|---|
458 | Is this something that should have try/catch around the invocation here? So one error handler doesn't impact the others from running? |
src/error/PhutilErrorHandler.php | ||
---|---|---|
458 | Yeah, good idea. I'll try to diff something. |
src/error/PhutilErrorHandler.php | ||
---|---|---|
78 | How many callers are there? Can we make updates so this can be removed? Or is this something commonly used via extensions? |
src/error/PhutilErrorHandler.php | ||
---|---|---|
78 | It's not common to call this, but there might be some extensions that use it to integrate with some error reporting. We can remove it whenever we feel like. |