Page MenuHomePhorge

PhutilErrorHandler: support multiple error listeners
ClosedPublic

Authored by avivey on Aug 11 2023, 19:03.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 2, 14:45
Unknown Object (File)
Thu, May 2, 14:45
Unknown Object (File)
Wed, May 1, 19:13
Unknown Object (File)
Wed, May 1, 19:13
Unknown Object (File)
Wed, May 1, 19:13
Unknown Object (File)
Wed, May 1, 02:19
Unknown Object (File)
Tue, Apr 30, 18:41
Unknown Object (File)
Wed, Apr 24, 22:34

Details

Summary

Ref T15554. The plan is to add a new listener that will only listen to DEPRECATED events, and do something useful with them.

Test Plan

Test script in P26 shows registering 2 handlers and getting both invoked.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avivey requested review of this revision.Aug 11 2023, 19:03
avivey planned changes to this revision.Aug 11 2023, 19:03

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/.

avivey planned changes to this revision.Aug 12 2023, 06:51
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

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?

This revision is now accepted and ready to land.Nov 26 2023, 06:57

I like renaming the function!

We should probably have a timeline for removing the old function. Do we have a task for that?

I feel like that kind of task will just fall down into oblivion....

src/filesystem/PhutilErrorLog.php
31

done - T15677

I like renaming the function!

We should probably have a timeline for removing the old function. Do we have a task for that?

I feel like that kind of task will just fall down into oblivion....

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 :)

This revision was landed with ongoing or failed builds.Nov 27 2023, 18:32
This revision was automatically updated to reflect the committed changes.

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.

avivey added inline comments.
src/error/PhutilErrorHandler.php
458

Filed T15690, because I'm not sure how to handle that right now...