ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 $a_message = $this->tranlateException($a_code) . $a_message;
24 parent::__construct($a_message, $a_code);
25 }
26
27
32 protected function tranlateException($code) {
33 $message = 'An undefined Database Exception occured';
34 switch ($code) {
35 case static::DB_GENERAL:
36 $message = 'An undefined Database Exception occured';
37 break;
38 }
39
40 return $message . '. ';
41 }
42}
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