SQLException.php

Go to the documentation of this file.
00001 <?php 00002 /* 00003 * $Id: SQLException.php,v 1.2 2004/03/29 18:46:46 micha Exp $ 00004 * 00005 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00006 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00007 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00008 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00009 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00010 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00011 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00012 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00013 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00014 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00015 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00016 * 00017 * This software consists of voluntary contributions made by many individuals 00018 * and is licensed under the LGPL. For more information please see 00019 * <http://creole.phpdb.org>. 00020 */ 00021 00022 require_once 'Exception.php'; 00023 00031 class SQLException extends Exception 00032 { 00033 00035 var $userInfo; 00036 00038 var $nativeError; 00039 00046 function SQLException($code, $msg, $native = null, $userinfo = null) 00047 { 00048 parent::Exception($code, $msg); 00049 00050 if ($native !== null) { 00051 $this->setNativeError($native); 00052 } 00053 if ($userinfo !== null) { 00054 $this->setUserInfo($userinfo); 00055 } 00056 } 00057 00064 function setUserInfo($info) 00065 { 00066 $this->userInfo = $info; 00067 $this->message .= " [User Info: " .$this->userInfo . "]"; 00068 } 00069 00075 function getUserInfo() 00076 { 00077 return $this->userInfo; 00078 } 00079 00086 function setNativeError($msg) 00087 { 00088 $this->nativeError = $msg; 00089 $this->message .= " [Native Error: " .$this->nativeError . "]"; 00090 } 00091 00097 function getNativeError() 00098 { 00099 return $this->nativeError; 00100 } 00101 00109 }

This file is part of the Creole[php4] library.


Copyright © 2004 Hans Lellelid  
Creole[php4] CVS