ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilWACException.php
Go to the documentation of this file.
1<?php
2require_once('./Services/Exceptions/classes/class.ilException.php');
3
11{
12 const CODE_NO_TYPE = 9001;
13 const CODE_NO_PATH = 9002;
16 const WRONG_PATH_TYPE = 9005;
19 const ACCESS_DENIED = 9010;
22 const MAX_LIFETIME = 9013;
26 protected static $messages = array(
27 self::CODE_NO_TYPE => 'No type for Path-Signing selected',
28 self::WRONG_PATH_TYPE => 'This path-type cannot be signed',
29 self::CODE_NO_PATH => 'No path for checking available',
30 self::ACCESS_WITHOUT_CHECK => 'Resource could not be found',
31 self::NO_CHECKING_INSTANCE => 'This path is not secured by a class',
32 self::ACCESS_DENIED => 'Resource could not be found',
33 self::ACCESS_DENIED_NO_PUB => 'Resource could not be found',
34 self::INITIALISATION_FAILED => 'An error occured during your request. Please reload the page.',
35 self::DATA_DIR_NON_WRITEABLE => 'The SALT cannot be written to your /data directory. Please check the write permissions on the webserver.',
36 self::MAX_LIFETIME => 'You can only only use lifetimes shorter than ilWACSignedPath::MAX_LIFETIME',
37 );
38
39
44 public function __construct($code, $additional_message = '')
45 {
47
48 if ($this->isNonEmptyString($additional_message)) {
49 $message = "\"{$this->message}\" with additional message: \"$additional_message\"";
50 }
51
52 //ilWACLog::getInstance()->write('Exception in ' . $this->getFile() . ':' . $this->getLine() . ': ' . $message);
53 parent::__construct($message, $code);
54 }
55
56
64 private function isNonEmptyString($text)
65 {
66 assert(is_string($text));
67
68 return strcmp($text, '') !== 0;
69 }
70}
An exception for terminatinating execution or to throw for unit testing.
Base class for ILIAS Exception handling.
Class ilWACException.
__construct($code, $additional_message='')
isNonEmptyString($text)
Checks if the given text is empty or not.
$messages
Definition: en.php:5
$code
Definition: example_050.php:99
catch(Exception $e) $message
$text
Definition: errorreport.php:18