Update javascript/ql/src/Quality/UnhandledStreamPipe.qhelp

Co-authored-by: Asger F <asgerf@github.com>
This commit is contained in:
Napalys Klicius
2025-06-02 17:41:55 +02:00
parent abd446ae77
commit 7198372ae5

View File

@@ -11,7 +11,7 @@ In Node.js, calling the <code>pipe()</code> method on a stream without proper er
<recommendation>
<p>
Instead of using <code>pipe()</code> with manual error handling, prefer using the <code>pipeline</code> function from the Node.js stream module. The <code>pipeline</code> function automatically handles errors and ensures proper cleanup of resources. This approach is more robust and eliminates the risk of forgetting to handle errors.
Instead of using <code>pipe()</code> with manual error handling, prefer using the <code>pipeline</code> function from the Node.js <code>stream</code> module. The <code>pipeline</code> function automatically handles errors and ensures proper cleanup of resources. This approach is more robust and eliminates the risk of forgetting to handle errors.
</p>
<p>
If you must use <code>pipe()</code>, always attach an error handler to the source stream using methods like <code>on('error', handler)</code> to ensure that any errors during the streaming process are properly handled.