ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
exception.ilDatabaseException.php
Go to the documentation of this file.
1<?php
2
3require_once("./Services/Exceptions/classes/class.ilException.php");
4
12{
13 const DB_GENERAL = 10000;
14
15
22 public function __construct($a_message, $a_code = self::DB_GENERAL)
23 {
24 $a_message = $this->tranlateException($a_code) . $a_message;
25 parent::__construct($a_message, $a_code);
26 }
27
28
33 protected function tranlateException($code)
34 {
35 $message = 'An undefined Database Exception occured';
36 switch ($code) {
37 case static::DB_GENERAL:
38 $message = 'An undefined Database Exception occured';
39 break;
40 }
41
42 return $message . '. ';
43 }
44}
An exception for terminatinating execution or to throw for unit testing.
Class ilDatabaseException.
__construct($a_message, $a_code=self::DB_GENERAL)
ilDatabaseException constructor.
Base class for ILIAS Exception handling.
$code
Definition: example_050.php:99
catch(Exception $e) $message