Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
PHP
at commit 034ff3c8
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677<?php
final class PhabricatorDefaultRequestExceptionHandler extends PhabricatorRequestExceptionHandler {
public function getRequestExceptionHandlerPriority() { return 900000; }
public function getRequestExceptionHandlerDescription() { return pht('Handles all other exceptions.'); }
public function canHandleRequestException( AphrontRequest $request, Exception $ex) {
if (!$this->isPhabricatorSite($request)) { return false; }
return true; }
public function handleRequestException( AphrontRequest $request, Exception $ex) {
$viewer = $this->getViewer($request);
// Always log the unhandled exception. phlog($ex);
$class = get_class($ex); $message = $ex->getMessage();
if ($ex instanceof AphrontSchemaQueryException) { $message .= "\n\n".pht( "NOTE: This usually indicates that the MySQL schema has not been ". "properly upgraded. Run '%s' to ensure your schema is up to date.", 'bin/storage upgrade'); }
if (PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) { $trace = id(new AphrontStackTraceView()) ->setUser($viewer) ->setTrace($ex->getTrace()); } else { $trace = null; }
$content = phutil_tag( 'div', array('class' => 'aphront-unhandled-exception'), array( phutil_tag('div', array('class' => 'exception-message'), $message), $trace, ));
$dialog = new AphrontDialogView(); $dialog ->setTitle(pht('Unhandled Exception ("%s")', $class)) ->setClass('aphront-exception-dialog') ->setUser($viewer) ->appendChild($content);
if ($request->isAjax()) { $dialog->addCancelButton('/', pht('Close')); }
return id(new AphrontDialogResponse()) ->setDialog($dialog) ->setHTTPResponseCode(500); }
}