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 2cc898a6
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081<?php
final class AphrontUnhandledExceptionResponse extends AphrontStandaloneHTMLResponse {
private $exception;
public function setException(Exception $exception) { $this->exception = $exception; return $this; }
public function getHTTPResponseCode() { return 500; }
protected function getResources() { return array( 'css/application/config/config-template.css', 'css/application/config/unhandled-exception.css', ); }
protected function getResponseTitle() { $ex = $this->exception;
if ($ex instanceof AphrontUsageException) { return $ex->getTitle(); } else { return pht('Unhandled Exception'); } }
protected function getResponseBodyClass() { return 'unhandled-exception'; }
protected function getResponseBody() { $ex = $this->exception;
if ($ex instanceof AphrontUsageException) { $title = $ex->getTitle(); } else { $title = get_class($ex); }
$body = $ex->getMessage(); $body = phutil_escape_html_newlines($body);
return phutil_tag( 'div', array( 'class' => 'unhandled-exception-detail', ), array( phutil_tag( 'h1', array( 'class' => 'unhandled-exception-title', ), $title), phutil_tag( 'div', array( 'class' => 'unhandled-exception-body', ), $body), )); }
protected function buildPlainTextResponseString() { $ex = $this->exception;
return pht( '%s: %s', get_class($ex), $ex->getMessage()); }
}