ProviderAlreadyExistsException.php 992 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCP\Federation\Exceptions;
  7. use OCP\HintException;
  8. /**
  9. * Class ProviderAlreadyExistsException
  10. *
  11. *
  12. * @since 14.0.0
  13. */
  14. class ProviderAlreadyExistsException extends HintException {
  15. /**
  16. * ProviderAlreadyExistsException constructor.
  17. *
  18. * @since 14.0.0
  19. *
  20. * @param string $newProviderId cloud federation provider ID of the new provider
  21. * @param string $existingProviderName name of cloud federation provider which already use the same ID
  22. */
  23. public function __construct($newProviderId, $existingProviderName) {
  24. $l = \OCP\Util::getL10N('federation');
  25. $message = 'ID "' . $newProviderId . '" already used by cloud federation provider "' . $existingProviderName . '"';
  26. $hint = $l->t('ID "%1$s" already used by cloud federation provider "%2$s"', [$newProviderId, $existingProviderName]);
  27. parent::__construct($message, $hint);
  28. }
  29. }