Page MenuHomePhabricator

Dispose writeguard correctly when responding to an early exception / better error pages
Closed, ResolvedPublic

Description

Our handling of early / top-level exceptions isn't as good as it could be:

  • Exceptions early enough in the stack don't dispose of the writeguard, which goes to the error log and confuses users reporting issues and sometimes emits errors in undesirable contexts.
  • One of these has generated a couple of false positive reports on HackerOne.
  • Errors in this class generally emit a plaintext page, but some of these errors are normal/expected results of user actions (like using the wrong domain to reach the host). On hosted instances, things like instances in maintenance states and nonexistent instances also end up in this flow. In these cases at a minimum, we should emit an intentional-looking page instead of an unsettlingly bare error page.