Issues (1513)

lib/exceptions/serviceunavailableexception.php (1 issue)

Severity
1
<?php
2
/*
3
 * SPDX-License-Identifier: AGPL-3.0-only
4
 * SPDX-FileCopyrightText: Copyright 2007-2016 Zarafa Deutschland GmbH
5
 * SPDX-FileCopyrightText: Copyright 2020-2022 grommunio GmbH
6
 *
7
 * Exception sending a "503 Service Unavailable" to the mobile.
8
 */
9
10
class ServiceUnavailableException extends HTTPReturnCodeException {
11
	protected $defaultLogLevel = LOGLEVEL_INFO;
12
	protected $httpReturnCode = HTTP_CODE_503;
13
	protected $httpReturnMessage = "Service Unavailable";
14
	protected $httpHeaders = [];
15
	protected $showLegal = false;
16
17
	public function __construct($message = "", $code = 0, $previous = null, $logLevel = false) {
18
		parent::__construct($message, $code, $previous, $logLevel);
19
		if (RETRY_AFTER_DELAY !== false) {
0 ignored issues
show
The condition RETRY_AFTER_DELAY !== false is always true.
Loading history...
20
			$this->httpHeaders[] = 'Retry-After: ' . RETRY_AFTER_DELAY;
21
		}
22
	}
23
}
24