Skip to content

Commit 67d88d4

Browse files
committed
We need to handle Throwable in handleError
1 parent 6653656 commit 67d88d4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/React/Decoder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
use React\Stream\ReadableStreamInterface;
88
use React\Stream\WritableStreamInterface;
99
use React\Stream\Util;
10-
use Exception;
1110
use RuntimeException;
1211
use Clue\React\NDJson\Decoder as NDJsonDecoder;
1312
use EdgeTelemetrics\JSON_RPC\Notification;
1413
use EdgeTelemetrics\JSON_RPC\Request;
1514
use EdgeTelemetrics\JSON_RPC\Response;
1615
use EdgeTelemetrics\JSON_RPC\Error;
16+
use Throwable;
1717
use function array_key_exists;
1818
use function is_array;
1919

@@ -134,7 +134,7 @@ public function handleData($input)
134134
}
135135
$this->emit('data', [$jsonrpc]);
136136
}
137-
} catch (\Throwable $ex) {
137+
} catch (Throwable $ex) {
138138
$this->handleError($ex);
139139
}
140140
}
@@ -149,10 +149,10 @@ public function handleEnd()
149149
}
150150

151151
/**
152-
* @param Exception $error
152+
* @param Throwable $error
153153
* @internal
154154
*/
155-
public function handleError(Exception $error)
155+
public function handleError(Throwable $error)
156156
{
157157
$this->emit('error', array($error));
158158
$this->close();

0 commit comments

Comments
 (0)