Page MenuHomePhabricator

Let the top-level exception handler dump a stack trace if we reach debug mode before things go sideways
ClosedPublic

Authored by epriestley on Mon, Feb 11, 9:10 PM.

Details

Summary

Depends on D20140. Ref T13250. Currently, the top-level exception handler doesn't dump stacks because we might not be in debug mode, and we might double-extra-super fatal if we call PhabricatorEnv:... to try to figure out if we're in debug mode or not.

We can get around this by setting a flag on the Sink once we're able to confirm that we're in debug mode. Then it's okay for the top-level error handler to show traces.

There's still some small possibility that showing a trace could make us double-super-fatal since we have to call a little more code, but AphrontStackTraceView is pretty conservative about what it does and 99% of the time this is a huge improvement.

Test Plan

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Mon, Feb 11, 9:10 PM
epriestley requested review of this revision.Mon, Feb 11, 9:12 PM
amckinley accepted this revision.Mon, Feb 11, 11:05 PM
amckinley added inline comments.
src/aphront/sink/AphrontHTTPSink.php
7–8

I just happened to notice this "do install" typo.

This revision is now accepted and ready to land.Mon, Feb 11, 11:05 PM
  • Just remove that comment since we don't do either one, even though they're technically possible.
This revision was automatically updated to reflect the committed changes.