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