ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilSystemStyleException.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
25 {
26  public const PARSING_JSON_FAILED = 1;
27 
28  public const EMPTY_ENTRY = 1001;
29  public const INVALID_MANDATORY_ENTRY_ATTRIBUTE = 1002;
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 SCSS_COMPILE_FAILED = 2004;
41  public const FOLDER_DELETION_FAILED = 2005;
42  public const FILE_DELETION_FAILED = 2006;
43  public const SCSS_NOT_INSTALLED = 2007;
44  public const FOLDER_OPENING_FAILED = 2008;
45 
46 
47  public const SKIN_FOLDER_DOES_NOT_EXIST = 3001;
48  public const SKIN_CSS_DOES_NOT_EXIST = 3002;
49 
50  public const NO_STYLE_ID = 5001;
51  public const NO_SKIN_ID = 5002;
52  public const NO_PARENT_STYLE = 5003;
53  public const NOT_EXISTING_STYLE = 5004;
54  public const NOT_EXISTING_SKIN = 5005;
55 
56  public const SKIN_ALREADY_EXISTS = 6001;
57 
58  public const SUBSTYLE_ASSIGNMENT_EXISTS = 7001;
59 
60  protected function assignMessageToCode(): void
61  {
62  switch ($this->code) {
63  case self::EMPTY_ENTRY:
64  $this->message = 'Empty Entry ' . $this->add_info;
65  break;
66  case self::PARSING_JSON_FAILED:
67  $this->message = 'Parsing JSON Failed ' . $this->add_info;
68  break;
69  case self::INVALID_MANDATORY_ENTRY_ATTRIBUTE:
70  $this->message = 'Invalid mandatory entry Attribute: ' . $this->add_info;
71  break;
72  case self::DUPLICATE_ENTRY:
73  $this->message = 'There are entries with the same ID. Duplicate: ' . $this->add_info;
74  break;
75  case self::DUPLICATE_ROOT_ENTRY:
76  $this->message = 'There are multiple root entry. Duplicate: ' . $this->add_info;
77  break;
78  case self::INVALID_ID:
79  $this->message = 'No such ID found in list or tree: ' . $this->add_info;
80  break;
81  case self::INVALID_CHARACTERS_IN_ID:
82  $this->message = 'The ID given contains invalid characters: ' . $this->add_info;
83  break;
84  case self::INVALID_FILE_PATH:
85  $this->message = 'Invalid file path or file not readable: ' . $this->add_info;
86  break;
87  case self::FILE_CREATION_FAILED:
88  $this->message = 'File creation failed, path: ' . $this->add_info;
89  break;
90  case self::FOLDER_CREATION_FAILED:
91  $this->message = 'Folder creation failed, path: ' . $this->add_info;
92  break;
93  case self::FOLDER_DELETION_FAILED:
94  $this->message = 'Folder delation failed, path: ' . $this->add_info;
95  break;
96  case self::FILE_DELETION_FAILED:
97  $this->message = 'File delation failed, path: ' . $this->add_info;
98  break;
99  case self::SCSS_COMPILE_FAILED:
100  $this->message = 'Compilation of scss failed: ' . $this->add_info;
101  break;
102  case self::FILE_OPENING_FAILED:
103  $this->message = 'Failed to open file : ' . $this->add_info;
104  break;
105  case self::FOLDER_OPENING_FAILED:
106  $this->message = 'Failed to open folder : ' . $this->add_info;
107  break;
108  case self::SKIN_CSS_DOES_NOT_EXIST:
109  $this->message = 'Skin CSS does not exist: ' . $this->add_info;
110  break;
111  case self::SKIN_FOLDER_DOES_NOT_EXIST:
112  $this->message = 'Skin folder does not exist: ' . $this->add_info;
113  break;
114  case self::INVALID_RULES_ENTRY:
115  $this->message = 'Invalid rules entry: ' . $this->add_info;
116  break;
117  case self::NO_STYLE_ID:
118  $this->message = 'No Style ID is given.';
119  break;
120  case self::NO_SKIN_ID:
121  $this->message = 'No Skin ID is given.';
122  break;
123  case self::NOT_EXISTING_SKIN:
124  $this->message = 'Skin does not exist: ' . $this->add_info;
125  break;
126  case self::NOT_EXISTING_STYLE:
127  $this->message = 'Style does not exist: ' . $this->add_info;
128  break;
129  case self::SKIN_ALREADY_EXISTS:
130  $this->message = 'Skin already exists: ' . $this->add_info;
131  break;
132  case self::NO_PARENT_STYLE:
133  $this->message = 'No parent style defined for style: ' . $this->add_info;
134  break;
135  case self::SUBSTYLE_ASSIGNMENT_EXISTS:
136  $this->message = 'The assignment of this substyle already exists: ' . $this->add_info;
137  break;
138  case self::SCSS_NOT_INSTALLED:
139  $this->message = 'No scss compiler is installed';
140  break;
141  default:
142  $this->message = 'Unknown Exception ' . $this->add_info;
143  break;
144  }
145  }
146 }
Class for advanced editing exception handling in ILIAS.