Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894300
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/aphront/response/AphrontUnhandledExceptionResponse.php b/src/aphront/response/AphrontUnhandledExceptionResponse.php
index 00035ec92f..c741c35898 100644
--- a/src/aphront/response/AphrontUnhandledExceptionResponse.php
+++ b/src/aphront/response/AphrontUnhandledExceptionResponse.php
@@ -1,74 +1,80 @@
<?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() {
- return pht('Unhandled Exception');
+ $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());
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 19, 19:42 (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128084
Default Alt Text
(2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment