Page MenuHomePhorge

Replace usages of PhutilProxyException
ClosedPublic

Authored by mainframe98 on Wed, Apr 9, 18:16.

Details

Summary

This exception only exists for backwards compatibility with PHP versions
older than 5.3.0.
See https://www.php.net/manual/en/exception.getprevious.php

This marks PhutilProxyException as deprecated, as there is no need to use
it anymore. Removing it outright would break existing code.
The relevant methods of PhutilErrorHandler have also been marked for
deprecation, and simplified to always call Exception::getPrevious.

Test Plan

Throw an exception that nests another exception and compare the error report.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

aklapper subscribed.

Thanks! Small nitpick: I'd probably change @deprecated call Exception::getPrevious directly. to @deprecated Call Exception::getPrevious() directly.

Tested with PHP 8.3 by randomly changing https://we.phorge.it/source/phorge/browse/master/src/view/phui/PHUIHeaderView.php;43539b220ce28869073422a772ad72c793a7d310$275 from } to }}.
After applying the patch, output rendered for the three exceptions on http://phorge.localhost/project/ is exactly the same as before, and output in local error_log file is also the same as before.

Code in PhutilProxyException::__construct() and in PhutilErrorHandler::getPreviousException() isn't reached anymore after this patch, as expected (checked by inserting phlog()s, basically).

This revision is now accepted and ready to land.Sat, Apr 12, 20:45
This revision was landed with ongoing or failed builds.Sun, Apr 13, 10:03
This revision was automatically updated to reflect the committed changes.