Merge "maintenance: Script to rename titles for Unicode uppercasing changes"
[lhc/web/wiklou.git] / includes / libs / services / NoSuchServiceException.php
1 <?php
2
3 namespace Wikimedia\Services;
4
5 use Exception;
6 use Psr\Container\NotFoundExceptionInterface;
7 use RuntimeException;
8
9 /**
10 * Exception thrown when the requested service is not known.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 * http://www.gnu.org/copyleft/gpl.html
26 *
27 * @file
28 *
29 * @since 1.27
30 */
31
32 /**
33 * Exception thrown when the requested service is not known.
34 */
35 class NoSuchServiceException extends RuntimeException
36 implements NotFoundExceptionInterface {
37
38 /**
39 * @param string $serviceName
40 * @param Exception|null $previous
41 */
42 public function __construct( $serviceName, Exception $previous = null ) {
43 parent::__construct( "No such service: $serviceName", 0, $previous );
44 }
45
46 }
47
48 /**
49 * Retain the old class name for backwards compatibility.
50 * @deprecated since 1.33
51 */
52 class_alias( NoSuchServiceException::class, 'MediaWiki\Services\NoSuchServiceException' );