1
0
Fork 0

Throw RuntimeException instead of die()

pull/110/head
Kaloyan Raev 2016-10-24 14:15:07 +03:00
parent 2c1d65db68
commit e7611dc629
2 changed files with 2 additions and 2 deletions

View File

@ -6,6 +6,7 @@ namespace LanguageServer;
use LanguageServer\Protocol\Message; use LanguageServer\Protocol\Message;
use AdvancedJsonRpc\Message as MessageBody; use AdvancedJsonRpc\Message as MessageBody;
use Sabre\Event\Loop; use Sabre\Event\Loop;
use RuntimeException;
abstract class ParsingMode abstract class ParsingMode
{ {
@ -30,7 +31,7 @@ class ProtocolStreamReader implements ProtocolReader
$this->input = $input; $this->input = $input;
Loop\addReadStream($this->input, function() { Loop\addReadStream($this->input, function() {
if (feof($this->input)) { if (feof($this->input)) {
die; throw new RuntimeException("Stream is closed.");
} }
while (($c = fgetc($this->input)) !== false && $c !== '') { while (($c = fgetc($this->input)) !== false && $c !== '') {

View File

@ -4,7 +4,6 @@ declare(strict_types = 1);
namespace LanguageServer; namespace LanguageServer;
use LanguageServer\Protocol\Message; use LanguageServer\Protocol\Message;
use RuntimeException;
class ProtocolStreamWriter implements ProtocolWriter class ProtocolStreamWriter implements ProtocolWriter
{ {