1: <?php
2: /**
3: * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
4: * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
5: *
6: * Licensed under The MIT License
7: * Redistributions of files must retain the above copyright notice.
8: *
9: * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
10: * @since 3.1.7
11: * @license https://opensource.org/licenses/mit-license.php MIT License
12: */
13: namespace Cake\Http\Exception;
14:
15: /**
16: * Represents an HTTP 503 error.
17: */
18: class ServiceUnavailableException extends HttpException
19: {
20:
21: /**
22: * {@inheritDoc}
23: */
24: protected $_defaultCode = 503;
25:
26: /**
27: * Constructor
28: *
29: * @param string|null $message If no message is given 'Service Unavailable' will be the message
30: * @param int $code Status code, defaults to 503
31: * @param \Exception|null $previous The previous exception.
32: */
33: public function __construct($message = null, $code = null, $previous = null)
34: {
35: if (empty($message)) {
36: $message = 'Service Unavailable';
37: }
38: parent::__construct($message, $code, $previous);
39: }
40: }
41: