ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilCloudException.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once './Services/Exceptions/classes/class.ilException.php';
5
15{
17
18 const NO_SERVICE_ACTIVE = 1001;
19 const NO_SERVICE_SELECTED = 1002;
20 const SERVICE_NOT_ACTIVE = 1003;
23
27
29 const DELETE_FAILED = 2101;
30 const DOWNLOAD_FAILED = 2201;
32 const UPLOAD_FAILED = 2401;
35
36 const INVALID_INPUT = 3001;
37
41
42 const PERMISSION_DENIED = 5001;
44
45 protected $message;
46 protected $code;
47 protected $add_info;
48
53 public function __construct($exception_code, $exception_info = "")
54 {
55
56
57 $this->code = $exception_code;
58 $this->add_info = $exception_info;
59 $this->assignMessageToCode();
60 parent::__construct($this->message, $this->code);
61
62 }
63
64 protected function assignMessageToCode()
65 {
66 global $lng;
67 switch ($this->code)
68 {
70 $this->message = $lng->txt("cld_no_service_active");
71 break;
73 $this->message = $lng->txt("cld_no_service_selected");
74 break;
76 $this->message = $lng->txt("cld_service_not_active");
77 break;
79 $this->message = $lng->txt("cld_service_class_file_not_found");
80 break;
82 $this->message = $lng->txt("cld_folder_not_existing_on_service");
83 break;
85 $this->message = $lng->txt("cld_folder_already_existing_on_service");
86 break;
88 $this->message = $lng->txt("cld_file_not_existing_on_service");
89 break;
91 $this->message = $lng->txt("cld_authentication_failed");
92 break;
94 $this->message = $lng->txt("cld_delete_failed");
95 break;
97 $this->message = $lng->txt("cld_add_items_from_service_failed");
98 break;
100 $this->message = $lng->txt("cld_add_download_failed");
101 break;
103 $this->message = $lng->txt("cld_folder_creation_failed");
104 break;
106 $this->message = $lng->txt("cld_upload_failed");
107 break;
109 $this->message = $lng->txt("cld_upload_failed_max_filesize");
110 break;
112 $this->message = $lng->txt("cld_invalid_input");
113 break;
115 $this->message = $lng->txt("cld_path_does_not_exist_in_file_tree_in_session");
116 break;
118 $this->message = $lng->txt("cld_id_does_not_exist_in_file_tree_in_session");
119 break;
121 $this->message = $lng->txt("cld_id_already_exists_in_file_tree_in_session");
122 break;
124 $this->message = $lng->txt("cld_plugin_hook_could_not_be_instantiated");
125 break;
127 $this->message = $lng->txt("cld_permission_denied");
128 break;
130 $this->message = $lng->txt("cld_permission_to_change_root_folder_denied");
131 break;
132 default:
133 $this->message = $lng->txt("cld_unknown_exception");
134 break;
135 }
136 $this->message .= ($this->add_info ? ": " : "") . $this->add_info;
137 }
138
139 public function __toString()
140 {
141 return get_class($this) . " '{$this->message}' in {$this->file}({$this->line})\n"
142 . "{$this->getTraceAsString()}";
143 }
144
145}
146?>
Class ilCloudException.
const PERMISSION_TO_CHANGE_ROOT_FOLDER_DENIED
const PATH_DOES_NOT_EXIST_IN_FILE_TREE_IN_SESSION
const ID_DOES_NOT_EXIST_IN_FILE_TREE_IN_SESSION
const ID_ALREADY_EXISTS_IN_FILE_TREE_IN_SESSION
__construct($exception_code, $exception_info="")
Base class for ILIAS Exception handling.
global $lng
Definition: privfeed.php:40