better error handling
This commit is contained in:
@@ -252,8 +252,11 @@ class RPCProxy {
|
|||||||
|
|
||||||
// Capture and stream the response
|
// Capture and stream the response
|
||||||
response.data.on('data', (chunk) => {
|
response.data.on('data', (chunk) => {
|
||||||
|
// Always capture data for comparison purposes
|
||||||
|
responseData += chunk.toString();
|
||||||
|
|
||||||
|
// Only write to client if still connected
|
||||||
if (!isClientClosed() && !res.writableEnded) {
|
if (!isClientClosed() && !res.writableEnded) {
|
||||||
responseData += chunk.toString();
|
|
||||||
try {
|
try {
|
||||||
res.write(chunk);
|
res.write(chunk);
|
||||||
} catch (writeError) {
|
} catch (writeError) {
|
||||||
|
|||||||
Reference in New Issue
Block a user