ApiException will now string all of its exceptions together to form the message
authorRobert Sesek <rsesek@bluestatic.org>
Tue, 1 Jul 2008 21:50:15 +0000 (17:50 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 1 Jul 2008 21:50:15 +0000 (17:50 -0400)
* Api.php:
(ApiException::__construct): Add a prefix for the list of errors to be displayed
(ApiException::addException): Append the exception's message to ApiException->message

Api.php
CHANGES

diff --git a/Api.php b/Api.php
index a89747c9d1aa01759cb06e289d38bc075c619ee5..ea93263b406b863ef6b8e39b83bdbb10a27205a2 100644 (file)
--- a/Api.php
+++ b/Api.php
@@ -528,7 +528,7 @@ class ApiException extends Exception
         */
        public function __construct()
        {
-               parent::__construct(_('An error occurred while processing the API data.'));
+               parent::__construct(_('An error occurred while processing the API data. Errors: '));
        }
        
        /**
@@ -539,6 +539,7 @@ class ApiException extends Exception
        public function addException(Exception $e)
        {
                $this->exceptions[] = $e;
+               $this->message .= ' (' . sizeof($this->exceptions) . ') ' . $e->getMessage();
        }
        
        /**
diff --git a/CHANGES b/CHANGES
index de494b6595fa41d18b00275257238018910cd5a9..7493747d18d3d5db7cf0e8990a8d4df71c5ae065 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -12,3 +12,4 @@
 - New: In the BSTemplate::$preParseHook method, the second parameter will be the BSTemplate object itself
 - New: Add BSTemplate::$globalVars to be substituted into every template
 - Change: BSTemplate will better detect parse errors in nested templates in BSTemplate::evaluate()
+- Change: ApiException will now report all of its messages in ::getMessage()