diff --git a/src/error/PhutilAggregateException.php b/src/error/PhutilAggregateException.php index eec0305..17107fb 100644 --- a/src/error/PhutilAggregateException.php +++ b/src/error/PhutilAggregateException.php @@ -1,62 +1,62 @@ doSomething(); * $success = true; * break; * } catch (Exception $ex) { * $exceptions[] = $ex; * } * } * * if (!$success) { * throw new PhutilAggregateException("All engines failed:", $exceptions); * } * * @concrete-extensible * @group error */ class PhutilAggregateException extends Exception { private $exceptions = array(); public function __construct($message, array $other_exceptions) { $this->exceptions = $other_exceptions; $full_message = array(); $full_message[] = $message; foreach ($other_exceptions as $exception) { - $ex_message = $exception->getMessage(); + $ex_message = get_class($exception).': '.$exception->getMessage(); $ex_message = ' - '.str_replace("\n", "\n ", $ex_message); $full_message[] = $ex_message; } - parent::__construct(implode("\n", $full_message)); + parent::__construct(implode("\n", $full_message), count($other_exceptions)); } }