Page MenuHomePhorge

Error handling: send Deprecation messages as explicit Event
ClosedPublic

Authored by avivey on Aug 11 2023, 19:01.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jul 14, 04:14
Unknown Object (File)
Sat, Jul 13, 17:27
Unknown Object (File)
Sat, Jul 13, 12:35
Unknown Object (File)
Sat, Jul 13, 04:51
Unknown Object (File)
Sat, Jul 13, 00:31
Unknown Object (File)
Tue, Jul 9, 10:31
Unknown Object (File)
Mon, Jul 8, 13:52
Unknown Object (File)
Sat, Jul 6, 18:56

Details

Summary

Ref T15554. When a deprecation warning is captured here, mark it as such and send using the same channel as error messages.
Error Handlers will generally ignore it now, so they'll need to be updated, e.g. D25386

Test Plan

Hitting a strlen(null) before This Change:

  • Web:
    • PhutilAggregateException - white boxes with red border.
  • Daemons:
    • trace in daemon log, task fails. Daemon sleeps for 5 seconds.
  • Arcanist and Scripts in phorge/bin/ and phorge/scripts:
    • execution blows up with error trace.
  • SSH server-side scripts (ssh-auth and ssh-exec):
    • trace in configured log, execution fails
  • SSH client-side scripts (ssh-connect):
    • execution blows up with error trace.

After this change:

  • Web:
    • Before D25386: Nothing on screen, errors show in log.
    • With D25386: logs + dark console.
  • Daemons:
    • trace in daemon log, task completes successfully.
  • Arcanist and Scripts in phorge/bin/ and phorge/scripts/ :
    • Error trace printed to STDERR, execution continues.
  • SSH server-side scripts (ssh-auth and ssh-exec):
    • trace in configured log, execution continues.
  • SSH client-side scripts (ssh-connect):
    • Error trace printed to STDERR, execution continues.

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:01
avivey retitled this revision from Error handling - notify deprecation messages explicitly to Error handling: send Deprecation messages as explicit Event.Aug 12 2023, 17:06
avivey edited the test plan for this revision. (Show Details)

SUPER NICE \o/ THANKS

Tested putting random deprecated things there and there like array_key_exists('asd', new stdclass()) and now the page just works without any nuclear implosion, and DarkConsole just nicely reports the issue to dear developers \o/ super super super nice.

This revision is now accepted and ready to land.Aug 18 2023, 09:58

I'm thinking of adding similar handling for E_USER_NOTICE and E_USER_WARNING - to allow using them in extension code and in things like T15316 (Right now, we treat those as fatal errors too).