DatabaseException.php 781 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /** @package verysimple::DB */
  3. /**
  4. * DatabaseException is thrown when an error occurs that involves the database
  5. * @package verysimple::DB
  6. * @author VerySimple Inc.
  7. * @copyright 1997-2007 VerySimple, Inc.
  8. * @license http://www.gnu.org/licenses/lgpl.html LGPL
  9. * @version 1.0
  10. */
  11. class DatabaseException extends Exception
  12. {
  13. /** codes used to determine error sub-type */
  14. static $UNKNOWN = 0;
  15. static $CONNECTION_ERROR = 1;
  16. static $ERROR_IN_QUERY = 2;
  17. public $data;
  18. // Redefine the constructor so message isn't optional
  19. public function __construct($message, $code = 0, $data = "")
  20. {
  21. // make sure everything is assigned properly
  22. parent::__construct($message, $code);
  23. $this->data = $data;
  24. }
  25. }
  26. ?>