fix: Converting circular structure to JSON

This commit is contained in:
Draculabo committed 2026-01-15 22:58:05 +08:00
1 parent 5a004d9d16
commit b0ec96d4a6
5 files changed
+91 -12

No files matched your search

+8 -2
View File
@@ -217,7 +217,11 @@ export class ProxyService {
subscriber.complete();
});
upstreamStream.on('error', (err: any) => subscriber.error(err));
upstreamStream.on('error', (err: any) => {
// Convert to clean Error to avoid circular reference issues (socket objects)
const cleanError = err instanceof Error ? new Error(err.message) : new Error(String(err));
subscriber.error(cleanError);
});
});
}
@@ -372,7 +376,9 @@ export class ProxyService {
});
upstreamStream.on('error', (err: any) => {
subscriber.error(err);
// Convert to clean Error to avoid circular reference issues (socket objects)
const cleanError = err instanceof Error ? new Error(err.message) : new Error(String(err));
subscriber.error(cleanError);
});
});
}