]>
src.bluestatic.org Git - bugdar.git/blob - includes/class_api_error.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
25 * This class is used to catch different kinds of API errors and throw the
26 * appropriate front-size error depending on the context. Unlike normal
27 * handlers, this class can be both instantiated and used statically: check
28 * the method documentation for more information.
30 * @author Iris Studios, Inc.
31 * @copyright Copyright ©2002 - [#]year[#], Iris Studios, Inc.
36 class API_Error_Handler
39 * Instance of an object that can run erros
45 // ###################################################################
47 * Constructor: set the actionable object
51 * @param object Actionable object
53 function API_Error_Handler(&$obj)
55 $this->object =& $obj;
58 // ###################################################################
60 * The user-end cumulative reporter requires that the class be
61 * instantiated. This collects messages in the set message reporting
62 * object, but never throws the error. It is the caller's responsibility
63 * to check for the presence of errors and to throw the front-end
64 * warning using the message object.
68 * @param string Error message
70 function user_cumulative($error)
72 $this->object->add_error($error);
75 // ###################################################################
77 * This calls the simple ISSO.Printer error message for the
78 * administrative-side errors.
82 * @param string Error message
84 function admin_error($error)
86 $this->object->error($error);
90 /*=====================================================================*\
91 || ###################################################################
94 || ###################################################################
95 \*=====================================================================*/