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

Co-authored-by: Asger F <asgerf@github.com>
This commit is contained in:
Napalys Klicius
2025-06-03 13:43:45 +02:00
committed by GitHub
parent 7993f7d8c8
commit 8ba1f3f265

View File

@@ -14,7 +14,7 @@ In Node.js, calling the <code>pipe()</code> method on a stream without proper er
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.
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 emitted by the input stream are properly handled. When multiple <code>pipe()</code> calls are chained, an error handler should be attached before each step of the pipeline.
</p>
</recommendation>