root/trunk/common/mvblog_exception.php
| Revision 776, 1.0 KB (checked in by michiel, 9 months ago) |
|---|
| Line | |
|---|---|
| 1 | <?php |
| 2 | /** |
| 3 | * MvBlog -- An open source no-nosense blogtool |
| 4 | * |
| 5 | * Copyright (C) 2005-2008, Michiel van Baak |
| 6 | * Michiel van Baak <mvanbaak@users.sourceforge.net> |
| 7 | * |
| 8 | * See http://www.mvblog.org for more information on MvBlog. |
| 9 | * That page also provides Bugtrackers, Filereleases etc. |
| 10 | * |
| 11 | * This program is free software, distributed under the terms of |
| 12 | * the GNU General Public License Version 2. See the LICENSE file |
| 13 | * at the top of the source tree. |
| 14 | * |
| 15 | * @package MvBlog |
| 16 | * @author Ferry Boender |
| 17 | * @version %%VERSION%% |
| 18 | * @copyright 2005-2008 Ferry Boender |
| 19 | */ |
| 20 | |
| 21 | /** |
| 22 | * Exception class for MvBlog |
| 23 | */ |
| 24 | class mvblog_Exception extends Exception { |
| 25 | /** |
| 26 | * @var array $messages Array with exception messages |
| 27 | */ |
| 28 | protected $messages = array(); |
| 29 | |
| 30 | public function __construct($code) { |
| 31 | $args = func_get_args(); |
| 32 | array_shift($args); |
| 33 | if (array_key_exists($code, $this->messages)) |
| 34 | $message = vsprintf($this->messages[$code], $args); |
| 35 | else |
| 36 | $message = "Unknown error ".$code; |
| 37 | |
| 38 | parent::__construct($message, $code); |
| 39 | } |
| 40 | } |
| 41 | ?> |
Note: See TracBrowser
for help on using the browser.
