ServiceDisabledException.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace MediaWiki\Services;
  3. use Exception;
  4. use RuntimeException;
  5. /**
  6. * Exception thrown when trying to access a disabled service.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  21. * http://www.gnu.org/copyleft/gpl.html
  22. *
  23. * @file
  24. *
  25. * @since 1.27
  26. */
  27. /**
  28. * Exception thrown when trying to access a disabled service.
  29. */
  30. class ServiceDisabledException extends RuntimeException {
  31. /**
  32. * @param string $serviceName
  33. * @param Exception|null $previous
  34. */
  35. public function __construct( $serviceName, Exception $previous = null ) {
  36. parent::__construct( "Service disabled: $serviceName", 0, $previous );
  37. }
  38. }