OpenXE/classes/Components/Http/Exception/HttpHeaderValueException.php

24 lines
719 B
PHP
Raw Normal View History

2021-05-21 08:49:41 +02:00
<?php
namespace Xentral\Components\Http\Exception;
use RuntimeException;
use Throwable;
class HttpHeaderValueException extends RuntimeException implements HttpComponentExceptionInterface
{
public function __construct($message = '', $code = 0, Throwable $previous = null, $headerValue = null)
{
$headerString = '';
if ($headerValue === null) {
$headerString = 'null';
}
if (is_array($headerValue)) {
$headerString = sprintf('[%s]', implode(',', $headerValue));
}
$headerString = strval($headerString);
$message = sprintf('%s value:"%s"', $message, $headerString);
parent::__construct($message, $code, $previous);
}
}