ForbiddenException.php 908 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. // use OCP namespace for all classes that are considered public.
  8. // This means that they should be used by apps instead of the internal Nextcloud classes
  9. namespace OCP\Files;
  10. /**
  11. * Class ForbiddenException
  12. *
  13. * @since 9.0.0
  14. */
  15. class ForbiddenException extends \Exception {
  16. /** @var bool */
  17. private $retry;
  18. /**
  19. * @param string $message
  20. * @param bool $retry
  21. * @param \Exception|null $previous previous exception for cascading
  22. * @since 9.0.0
  23. */
  24. public function __construct($message, $retry, ?\Exception $previous = null) {
  25. parent::__construct($message, 0, $previous);
  26. $this->retry = $retry;
  27. }
  28. /**
  29. * @return bool
  30. * @since 9.0.0
  31. */
  32. public function getRetry() {
  33. return (bool) $this->retry;
  34. }
  35. }