Throw RuntimeException instead of die()
parent
2c1d65db68
commit
e7611dc629
|
@ -6,6 +6,7 @@ namespace LanguageServer;
|
|||
use LanguageServer\Protocol\Message;
|
||||
use AdvancedJsonRpc\Message as MessageBody;
|
||||
use Sabre\Event\Loop;
|
||||
use RuntimeException;
|
||||
|
||||
abstract class ParsingMode
|
||||
{
|
||||
|
@ -30,7 +31,7 @@ class ProtocolStreamReader implements ProtocolReader
|
|||
$this->input = $input;
|
||||
Loop\addReadStream($this->input, function() {
|
||||
if (feof($this->input)) {
|
||||
die;
|
||||
throw new RuntimeException("Stream is closed.");
|
||||
}
|
||||
|
||||
while (($c = fgetc($this->input)) !== false && $c !== '') {
|
||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types = 1);
|
|||
namespace LanguageServer;
|
||||
|
||||
use LanguageServer\Protocol\Message;
|
||||
use RuntimeException;
|
||||
|
||||
class ProtocolStreamWriter implements ProtocolWriter
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue