forked from felixfbecker/php-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContentTooLargeException.php
45 lines (40 loc) Β· 1.1 KB
/
ContentTooLargeException.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
declare(strict_types = 1);
namespace LanguageServer;
/**
* Thrown when the document content is not parsed because it exceeds the size limit
*/
class ContentTooLargeException extends \Exception
{
/**
* The URI of the file that exceeded the limit
*
* @var string
*/
public $uri;
/**
* The size of the file in bytes
*
* @var int
*/
public $size;
/**
* The limit that was exceeded in bytes
*
* @var int
*/
public $limit;
/**
* @param string $uri The URI of the file that exceeded the limit
* @param int $size The size of the file in bytes
* @param int $limit The limit that was exceeded in bytes
* @param \Throwable $previous The previous exception used for the exception chaining.
*/
public function __construct(string $uri, int $size, int $limit, \Throwable $previous = null)
{
$this->uri = $uri;
$this->size = $size;
$this->limit = $limit;
parent::__construct("$uri exceeds size limit of $limit bytes ($size)", 0, $previous);
}
}