From 887128203716c17e60e977ffb4b195ab43f93eec Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 7 Jul 2011 12:49:59 -0700 Subject: [PATCH] Linebreak stacktraces in exception messages Summary: This is a very small step toward making these good, but a concrete reduction in clowniness. Test Plan: Rigged an exception and got a more readable trace. Reviewed By: aran Reviewers: aran CC: aran Differential Revision: 607 --- .../AphrontDefaultApplicationConfiguration.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/aphront/default/configuration/AphrontDefaultApplicationConfiguration.php b/src/aphront/default/configuration/AphrontDefaultApplicationConfiguration.php index 5670f85abd..a36de405d8 100644 --- a/src/aphront/default/configuration/AphrontDefaultApplicationConfiguration.php +++ b/src/aphront/default/configuration/AphrontDefaultApplicationConfiguration.php @@ -361,10 +361,14 @@ class AphrontDefaultApplicationConfiguration $class = phutil_escape_html(get_class($ex)); $message = phutil_escape_html($ex->getMessage()); + $string = (string)$ex; + $string = phutil_escape_html($string); + $string = str_replace("\n", '
', $string); + $content = '
'. '

Unhandled Exception "'.$class.'": '.$message.'

'. - ''.phutil_escape_html((string)$ex).''. + ''.$string.''. '
'; $user = $this->getRequest()->getUser();