diff options
| author | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2021-07-22 16:07:19 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2021-07-22 16:19:12 +0200 |
| commit | a3da1483a9e689846179159355badfec8073dbec (patch) | |
| tree | 770dcca6bdf5f6f2a11b0e7fcbbeda6919a3fc52 /lib/exceptions | |
current code from svn, revision 62608
Diffstat (limited to 'lib/exceptions')
32 files changed, 786 insertions, 0 deletions
diff --git a/lib/exceptions/AccessDeniedException.php b/lib/exceptions/AccessDeniedException.php new file mode 100644 index 0000000..778211d --- /dev/null +++ b/lib/exceptions/AccessDeniedException.php @@ -0,0 +1,49 @@ +<?php +/** + * AccessDeniedException.php + * + * Use this exception whenever a user tries to access a restricted part of the + * system without having the required permissions. + * + * @author Marcus Lunzenauer <mlunzena@uos.de> + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ +class AccessDeniedException extends Exception +{ + private $details = []; + + /** + * Constucts the exception + * @param string $message Exception message + * @param integer $code Exception code + * @param Exception $previous Previous exception (optional) + */ + public function __construct($message = '', $code = 0, Exception $previous = null) + { + if (func_num_args() === 0) { + $message = _('Sie haben nicht die Berechtigung, diese Aktion ' + . 'auszuführen bzw. diesen Teil des Systems zu betreten.'); + } + + parent::__construct($message, $code, $previous); + } + + /** + * Set additional details for the exception. + * @param array $details Additional details + */ + public function setDetails(array $details) + { + $this->details = $details; + } + + /** + * Get the additional details for the exception. + * @return array Additional details + */ + public function getDetails() + { + return $this->details; + } +} diff --git a/lib/exceptions/CheckObjectException.php b/lib/exceptions/CheckObjectException.php new file mode 100644 index 0000000..2ffb2c4 --- /dev/null +++ b/lib/exceptions/CheckObjectException.php @@ -0,0 +1,18 @@ +<?php +# Lifter010: DONE +/** + * CheckObjectException.php - indicates that no object is selected + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Elmar Ludwig + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP +*/ + +class CheckObjectException extends Exception +{ +} diff --git a/lib/exceptions/ClipboardException.class.php b/lib/exceptions/ClipboardException.class.php new file mode 100644 index 0000000..676da93 --- /dev/null +++ b/lib/exceptions/ClipboardException.class.php @@ -0,0 +1,25 @@ +<?php + +/** + * ClipboardException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2019 + * @since 4.5 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a clipboard functionality cannot work + * as expected. + */ +class ClipboardException extends Exception +{ + +} diff --git a/lib/exceptions/InvalidSecurityTokenException.php b/lib/exceptions/InvalidSecurityTokenException.php new file mode 100644 index 0000000..134f54d --- /dev/null +++ b/lib/exceptions/InvalidSecurityTokenException.php @@ -0,0 +1,26 @@ +<?php +/** + * InvalidSecurityTokenException.php + * + * This exception is thrown when a request does not verify its authenticity. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author mlunzena@uos.de + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +class InvalidSecurityTokenException extends AccessDeniedException +{ + /** + * @param string this parameter is ignored but required by PHP + */ + public function __construct($message = '', $code = 0, Exception $previous = null) + { + parent::__construct(_('Ungültiges oder fehlendes Sicherheits-Token.')); + } +} diff --git a/lib/exceptions/InvalidValuesException.php b/lib/exceptions/InvalidValuesException.php new file mode 100644 index 0000000..aa86e2f --- /dev/null +++ b/lib/exceptions/InvalidValuesException.php @@ -0,0 +1,37 @@ +<?php +/** + * InvalidValuesException.php + * Exception class used by validation of forms. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Peter Thienel <thienel@data-quest.de> + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + * @since 3.5 + */ + +class InvalidValuesException extends Exception +{ + private $checked = []; + + /** + * Constructor + * + * @param string $message The error message + * @param array $checked Associative array + */ + public function __construct($message, $checked) + { + $this->checked = $checked; + parent::__construct($message); + } + + public function getChecked() + { + return $this->checked; + } +}
\ No newline at end of file diff --git a/lib/exceptions/LoginException.php b/lib/exceptions/LoginException.php new file mode 100644 index 0000000..9b83cb6 --- /dev/null +++ b/lib/exceptions/LoginException.php @@ -0,0 +1,24 @@ +<?php +# Lifter010: DONE +/** + * LoginException.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * +*/ + +/** + * Class LoginException + * If this exception is thrown, the user will get the login-screen immediately. + * If the user already was logged in he/she gets logged out and then to the login-screen. + * + * if ($GLOBALS['user']->id === "nobody") { + * throw new LoginException(); + * } + */ +class LoginException extends Exception +{ +} diff --git a/lib/exceptions/MethodNotAllowedException.php b/lib/exceptions/MethodNotAllowedException.php new file mode 100644 index 0000000..75f3b10 --- /dev/null +++ b/lib/exceptions/MethodNotAllowedException.php @@ -0,0 +1,23 @@ +<?php +/** + * MethodNotAllowedException.php + * + * This exceptions is thrown when a request's method is not allowed. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author mlunzena@uos.de + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +class MethodNotAllowedException extends Exception +{ + public function __construct($message = '', $code = 0, Exception $previous = null) + { + parent::__construct($message ?: _('Unzulässige Request-Methode beim Aufruf.'), $code, $previous); + } +} diff --git a/lib/exceptions/OverlapException.php b/lib/exceptions/OverlapException.php new file mode 100644 index 0000000..efac6e5 --- /dev/null +++ b/lib/exceptions/OverlapException.php @@ -0,0 +1,29 @@ +<?php +/** + * Exception class used to report overlapping errors + * + * @author Jan-Hendrik Willms <tleilax+studip@gmail.com> + * @license GPL2 or any later version + * @since Stud.IP 4.3 + */ +class OverlapException extends Exception +{ + protected $details; + + public function __construct($message = '', array $details = []) + { + parent::__construct($message); + + $this->setDetails($details); + } + + public function setDetails(array $details) + { + $this->details = $details; + } + + public function getDetails() + { + return $this->details; + } +} diff --git a/lib/exceptions/PluginInstallationException.php b/lib/exceptions/PluginInstallationException.php new file mode 100644 index 0000000..e4ff89e --- /dev/null +++ b/lib/exceptions/PluginInstallationException.php @@ -0,0 +1,7 @@ +<?php +/** + * Exception class used to report plugin install errors. + */ +class PluginInstallationException extends Exception +{ +} diff --git a/lib/exceptions/PluginNotFoundException.php b/lib/exceptions/PluginNotFoundException.php new file mode 100644 index 0000000..7b61ab3 --- /dev/null +++ b/lib/exceptions/PluginNotFoundException.php @@ -0,0 +1,17 @@ +<?php +# Lifter010: TODO +/** + * PluginNotFoundException.php - the requested plugin could not be found + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Marcus Lunzenauer <mlunzena@uos.de> + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +class PluginNotFoundException extends Exception { +} diff --git a/lib/exceptions/SessionRequiredException.php b/lib/exceptions/SessionRequiredException.php new file mode 100644 index 0000000..a90c679 --- /dev/null +++ b/lib/exceptions/SessionRequiredException.php @@ -0,0 +1,26 @@ +<?php +/** + * SessionRequiredException.php + * + * This exception is thrown when a token should have been stored in a + * non-existant session. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author mlunzena@uos.de + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +class SessionRequiredException extends Exception +{ + /** + * @param string this parameter is ignored but required by PHP + */ + function __construct($message = NULL) { + parent::__construct(_("Fehlende Session.")); + } +} diff --git a/lib/exceptions/StudipException.php b/lib/exceptions/StudipException.php new file mode 100644 index 0000000..e9bbf3d --- /dev/null +++ b/lib/exceptions/StudipException.php @@ -0,0 +1,36 @@ +<?php + +/** + * StudipException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2019 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This class is a specialisation of the standard Exception class + * with a specialisation to display exception data in Message boxes. + */ +class StudipException extends Exception +{ + protected $data = []; + + + public function __construct($message = '', Array $data = [], $code = 0, Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + $this->data = $data; + } + + public function getData() + { + return $this->data; + } +} diff --git a/lib/exceptions/resources/GlobalResourceLockException.class.php b/lib/exceptions/resources/GlobalResourceLockException.class.php new file mode 100644 index 0000000..165843f --- /dev/null +++ b/lib/exceptions/resources/GlobalResourceLockException.class.php @@ -0,0 +1,25 @@ +<?php + +/** + * GlobalResourceLockException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017-2019 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + * @since 4.5 + */ + +/** + * This exception is thrown when a general error occurs when dealing with + * GlobalResourceLock objects. + */ +class GlobalResourceLockException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/GlobalResourceLockOverlapException.class.php b/lib/exceptions/resources/GlobalResourceLockOverlapException.class.php new file mode 100644 index 0000000..6b05cf5 --- /dev/null +++ b/lib/exceptions/resources/GlobalResourceLockOverlapException.class.php @@ -0,0 +1,25 @@ +<?php + +/** + * GlobalResourceLockOverlapException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017-2019 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + * @since 4.5 + */ + +/** + * This exception is thrown when a global resource lock overlaps + * with another global resource lock. + */ +class GlobalResourceLockOverlapException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/InvalidResourceCategoryException.class.php b/lib/exceptions/resources/InvalidResourceCategoryException.class.php new file mode 100644 index 0000000..df4d36c --- /dev/null +++ b/lib/exceptions/resources/InvalidResourceCategoryException.class.php @@ -0,0 +1,25 @@ +<?php + +/** + * InvalidResourceCategoryException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a resource category does not exist + * or a resource is used with a resource category that does not match + * or when a resource category cannot be created due to invalid data. + */ +class InvalidResourceCategoryException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/InvalidResourceClassException.class.php b/lib/exceptions/resources/InvalidResourceClassException.class.php new file mode 100644 index 0000000..8420a83 --- /dev/null +++ b/lib/exceptions/resources/InvalidResourceClassException.class.php @@ -0,0 +1,24 @@ +<?php + +/** + * InvalidResourceClassException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a Resource object has an + * invalid class_name property. + */ +class InvalidResourceClassException extends Exception +{ + +} diff --git a/lib/exceptions/resources/InvalidResourceException.class.php b/lib/exceptions/resources/InvalidResourceException.class.php new file mode 100644 index 0000000..e9850b8 --- /dev/null +++ b/lib/exceptions/resources/InvalidResourceException.class.php @@ -0,0 +1,25 @@ +<?php + +/** + * InvalidResourceException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a resource is invalid, + * either because of its place in the resource hierarchy + * or because it has been initialised with the wrong Resource class. + */ +class InvalidResourceException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/InvalidResourceRequestException.class.php b/lib/exceptions/resources/InvalidResourceRequestException.class.php new file mode 100644 index 0000000..8ec9dab --- /dev/null +++ b/lib/exceptions/resources/InvalidResourceRequestException.class.php @@ -0,0 +1,22 @@ +<?php + +/** + * InvalidResourceRequestException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2020 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a resource request is invalid. + */ +class InvalidResourceRequestException extends InvalidArgumentException +{ +} diff --git a/lib/exceptions/resources/NoResourceClassException.class.php b/lib/exceptions/resources/NoResourceClassException.class.php new file mode 100644 index 0000000..74e68fd --- /dev/null +++ b/lib/exceptions/resources/NoResourceClassException.class.php @@ -0,0 +1,11 @@ +<?php + + +/** + * This exception is thrown in cases where a class name of a + * class which is derived from the base Resource class + * is expected but not available. + */ +class NoResourceClassException extends Exception +{ +} diff --git a/lib/exceptions/resources/ResourceBookingException.class.php b/lib/exceptions/resources/ResourceBookingException.class.php new file mode 100644 index 0000000..c1db11c --- /dev/null +++ b/lib/exceptions/resources/ResourceBookingException.class.php @@ -0,0 +1,24 @@ +<?php + +/** + * ResourceBookingException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a general error occurs when dealing with + * ResourceBooking objects. + */ +class ResourceBookingException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/ResourceBookingOverlapException.class.php b/lib/exceptions/resources/ResourceBookingOverlapException.class.php new file mode 100644 index 0000000..f59cc39 --- /dev/null +++ b/lib/exceptions/resources/ResourceBookingOverlapException.class.php @@ -0,0 +1,24 @@ +<?php + +/** + * ResourceBookingOverlapException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a resource booking overlaps with + * other resource bookings or with a resource lock. + */ +class ResourceBookingOverlapException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/ResourceBookingRangeException.class.php b/lib/exceptions/resources/ResourceBookingRangeException.class.php new file mode 100644 index 0000000..50e7144 --- /dev/null +++ b/lib/exceptions/resources/ResourceBookingRangeException.class.php @@ -0,0 +1,24 @@ +<?php + +/** + * ResourceBookingRangeException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a resource booking has an invalid range-ID + * or if a resource booking shall be created and no range-ID is given. + */ +class ResourceBookingRangeException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/ResourceException.class.php b/lib/exceptions/resources/ResourceException.class.php new file mode 100644 index 0000000..686cc33 --- /dev/null +++ b/lib/exceptions/resources/ResourceException.class.php @@ -0,0 +1,23 @@ +<?php + +/** + * ResourceException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is a general exception in the resource management. + */ +class ResourceException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/ResourceNoTimeRangeException.class.php b/lib/exceptions/resources/ResourceNoTimeRangeException.class.php new file mode 100644 index 0000000..891b583 --- /dev/null +++ b/lib/exceptions/resources/ResourceNoTimeRangeException.class.php @@ -0,0 +1,24 @@ +<?php + +/** + * ResourceNoTimeRangeException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when at least one time range is required + * in a method but no time range is provided. + */ +class ResourceNoTimeRangeException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/ResourcePermissionException.class.php b/lib/exceptions/resources/ResourcePermissionException.class.php new file mode 100644 index 0000000..3a0c919 --- /dev/null +++ b/lib/exceptions/resources/ResourcePermissionException.class.php @@ -0,0 +1,24 @@ +<?php + +/** + * ResourcePermissionException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when resource permissions are invalid + * or insufficient to perform an action on a resource. + */ +class ResourcePermissionException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/ResourcePropertyDefinitionException.class.php b/lib/exceptions/resources/ResourcePropertyDefinitionException.class.php new file mode 100644 index 0000000..963ca64 --- /dev/null +++ b/lib/exceptions/resources/ResourcePropertyDefinitionException.class.php @@ -0,0 +1,25 @@ +<?php + +/** + * ResourcePropertyDefinitionException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a resource property definition is requested + * but not defined for the resource property or if it is defined + * but cannot be stored. + */ +class ResourcePropertyDefinitionException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/ResourcePropertyException.class.php b/lib/exceptions/resources/ResourcePropertyException.class.php new file mode 100644 index 0000000..83f871f --- /dev/null +++ b/lib/exceptions/resources/ResourcePropertyException.class.php @@ -0,0 +1,25 @@ +<?php + +/** + * ResourcePropertyException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a resource property is requested + * but not defined for the resource type or if it is defined + * but cannot be stored. + */ +class ResourcePropertyException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/ResourcePropertyStateException.class.php b/lib/exceptions/resources/ResourcePropertyStateException.class.php new file mode 100644 index 0000000..1880265 --- /dev/null +++ b/lib/exceptions/resources/ResourcePropertyStateException.class.php @@ -0,0 +1,23 @@ +<?php + +/** + * ResourcePropertyStateException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a resource property state is invalid. + */ +class ResourcePropertyStateException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/ResourceRequestException.class.php b/lib/exceptions/resources/ResourceRequestException.class.php new file mode 100644 index 0000000..1e8d071 --- /dev/null +++ b/lib/exceptions/resources/ResourceRequestException.class.php @@ -0,0 +1,24 @@ +<?php + +/** + * ResourceRequestException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a resource request cannot be stored + * or another fatal error occurs when hanlding a ResourceRequest object. + */ +class ResourceRequestException extends InvalidArgumentException +{ + +} diff --git a/lib/exceptions/resources/ResourceUnavailableException.class.php b/lib/exceptions/resources/ResourceUnavailableException.class.php new file mode 100644 index 0000000..b335d14 --- /dev/null +++ b/lib/exceptions/resources/ResourceUnavailableException.class.php @@ -0,0 +1,24 @@ +<?php + +/** + * ResourceUnavailableException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a resource is requested + * but no resource request can be created for it. + */ +class ResourceUnavailableException extends Exception +{ + +} diff --git a/lib/exceptions/resources/ResourceUnlockableException.class.php b/lib/exceptions/resources/ResourceUnlockableException.class.php new file mode 100644 index 0000000..11bc92b --- /dev/null +++ b/lib/exceptions/resources/ResourceUnlockableException.class.php @@ -0,0 +1,24 @@ +<?php + +/** + * ResourceUnlockableException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2017 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is thrown when a resource shall be locked + * but no resource lock can be created for it. + */ +class ResourceUnlockableException extends Exception +{ + +} diff --git a/lib/exceptions/resources/SeparableRoomException.class.php b/lib/exceptions/resources/SeparableRoomException.class.php new file mode 100644 index 0000000..78c9912 --- /dev/null +++ b/lib/exceptions/resources/SeparableRoomException.class.php @@ -0,0 +1,24 @@ +<?php + +/** + * SeparableRoomException.class.php + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * @author Moritz Strohm <strohm@data-quest.de> + * @copyright 2019 + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +/** + * This exception is intended to be used in case of errors that are + * related to separable rooms. + */ +class SeparableRoomException extends InvalidArgumentException +{ + +} |
