Summary: `PhutilProxyException` provides the capability to nest exceptions. However, if we throw a `PhutilProxyException` then we currently only display the error message from the top-most exception. Instead, we should print all of the nested exception messages.
Test Plan: Faked an error, saw multiple lines of exception messages.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D9697
}
if (!$is_usage) {
- echo phutil_console_format(
- "**Exception**\n%s\n%s\n",
- $ex->getMessage(),
- '(Run with --trace for a full exception trace.)');
+ echo phutil_console_format("**Exception**\n");
+
+ while ($ex) {
+ echo $ex->getMessage()."\n";
+
+ if ($ex instanceof PhutilProxyException) {
+ $ex = $ex->getPreviousException();
+ } else {
+ $ex = null;
+ }
+ }
+
+ echo "(Run with --trace for a full exception trace.)\n";
}
exit(1);