source: pro-bachkim-filespace/sourcecode/api.violet.vn/plugins/sfPropel13Plugin/lib/vendor/propel/PropelException.php @ 19

Last change on this file since 19 was 19, checked in by dungnv, 11 years ago
File size: 1.7 KB
Line 
1<?php
2/*
3 *  $Id: PropelException.php 521 2007-01-05 13:29:36Z heltem $
4 *
5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 *
17 * This software consists of voluntary contributions made by many individuals
18 * and is licensed under the LGPL. For more information please see
19 * <http://propel.phpdb.org>.
20 */
21
22/**
23 * The base class of all exceptions thrown by Propel.
24 * @author     Hans Lellelid <hans@xmpl.org>
25 * @version    $Revision: 521 $
26 * @package    propel
27 */
28class PropelException extends Exception {
29
30        /** The nested "cause" exception. */
31        protected $cause;
32
33        function __construct($p1, $p2 = null) {
34
35                $cause = null;
36
37                if ($p2 !== null) {
38                        $msg = $p1;
39                        $cause = $p2;
40                } else {
41                        if ($p1 instanceof Exception) {
42                                $msg = "";
43                                $cause = $p1;
44                        } else {
45                                $msg = $p1;
46                        }
47                }
48
49                parent::__construct($msg);
50
51                if ($cause !== null) {
52                        $this->cause = $cause;
53                        $this->message .= " [wrapped: " . $cause->getMessage() ."]";
54                }
55        }
56
57        function getCause() {
58                return $this->cause;
59        }
60
61}
Note: See TracBrowser for help on using the repository browser.