ILIAS  release_8 Revision v8.24
class.ilSystemStyleException.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
26 public const PARSING_JSON_FAILED = 1;
27
28 public const EMPTY_ENTRY = 1001;
30 public const DUPLICATE_ENTRY = 1003;
31 public const DUPLICATE_ROOT_ENTRY = 1004;
32 public const INVALID_ID = 1005;
33 public const INVALID_FILE_PATH = 1006;
34 public const INVALID_RULES_ENTRY = 1007;
35 public const INVALID_CHARACTERS_IN_ID = 1008;
36
37 public const FILE_CREATION_FAILED = 2001;
38 public const FOLDER_CREATION_FAILED = 2002;
39 public const FILE_OPENING_FAILED = 2003;
40 public const LESS_COMPILE_FAILED = 2004;
41 public const FOLDER_DELETION_FAILED = 2005;
42 public const FILE_DELETION_FAILED = 2006;
43 public const LESSC_NOT_INSTALLED = 2007;
44
45 public const SKIN_FOLDER_DOES_NOT_EXIST = 3001;
46 public const SKIN_CSS_DOES_NOT_EXIST = 3002;
47
48 public const NO_STYLE_ID = 5001;
49 public const NO_SKIN_ID = 5002;
50 public const NO_PARENT_STYLE = 5003;
51 public const NOT_EXISTING_STYLE = 5004;
52 public const NOT_EXISTING_SKIN = 5005;
53
54 public const SKIN_ALREADY_EXISTS = 6001;
55
56 public const SUBSTYLE_ASSIGNMENT_EXISTS = 7001;
57
58 protected function assignMessageToCode(): void
59 {
60 switch ($this->code) {
62 $this->message = 'Empty Entry ' . $this->add_info;
63 break;
65 $this->message = 'Parsing JSON Failed ' . $this->add_info;
66 break;
68 $this->message = 'Invalid mandatory entry Attribute: ' . $this->add_info;
69 break;
71 $this->message = 'There are entries with the same ID. Duplicate: ' . $this->add_info;
72 break;
74 $this->message = 'There are multiple root entry. Duplicate: ' . $this->add_info;
75 break;
77 $this->message = 'No such ID found in list or tree: ' . $this->add_info;
78 break;
80 $this->message = 'The ID given contains invalid characters: ' . $this->add_info;
81 break;
83 $this->message = 'Invalid file path or file not readable: ' . $this->add_info;
84 break;
86 $this->message = 'File creation failed, path: ' . $this->add_info;
87 break;
89 $this->message = 'Folder creation failed, path: ' . $this->add_info;
90 break;
92 $this->message = 'Folder delation failed, path: ' . $this->add_info;
93 break;
95 $this->message = 'File delation failed, path: ' . $this->add_info;
96 break;
98 $this->message = 'Compilation of less failed: ' . $this->add_info;
99 break;
101 $this->message = 'Failed to open file : ' . $this->add_info;
102 break;
104 $this->message = 'Skin CSS does not exist: ' . $this->add_info;
105 break;
107 $this->message = 'Skin folder does not exist: ' . $this->add_info;
108 break;
110 $this->message = 'Invalid rules entry: ' . $this->add_info;
111 break;
113 $this->message = 'No Style ID is given.';
114 break;
115 case self::NO_SKIN_ID:
116 $this->message = 'No Skin ID is given.';
117 break;
119 $this->message = 'Skin does not exist: ' . $this->add_info;
120 break;
122 $this->message = 'Style does not exist: ' . $this->add_info;
123 break;
125 $this->message = 'Skin already exists: ' . $this->add_info;
126 break;
128 $this->message = 'No parent style defined for style: ' . $this->add_info;
129 break;
131 $this->message = 'The assignment of this substyle already exists: ' . $this->add_info;
132 break;
134 $this->message = 'No less compiler is installed';
135 break;
136 default:
137 $this->message = 'Unknown Exception ' . $this->add_info;
138 break;
139 }
140 }
141}
Class for advanced editing exception handling in ILIAS.
Class for advanced editing exception handling in ILIAS.