Skip to content

Commit 8ba1f3f

Browse files
Napalysasgerf
andauthored
Update javascript/ql/src/Quality/UnhandledStreamPipe.qhelp
Co-authored-by: Asger F <[email protected]>
1 parent 7993f7d commit 8ba1f3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

javascript/ql/src/Quality/UnhandledStreamPipe.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In Node.js, calling the <code>pipe()</code> method on a stream without proper er
1414
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.
1515
</p>
1616
<p>
17-
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.
17+
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.
1818
</p>
1919
</recommendation>
2020

0 commit comments

Comments
 (0)