We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
qhelp
1 parent bf2f19d commit 7993f7dCopy full SHA for 7993f7d
javascript/ql/src/Quality/examples/UnhandledStreamPipe.js
@@ -2,5 +2,7 @@ const fs = require('fs');
2
const source = fs.createReadStream('source.txt');
3
const destination = fs.createWriteStream('destination.txt');
4
5
-// Bad: No error handling
6
-source.pipe(destination);
+// Bad: Only destination has error handling, source errors are unhandled
+source.pipe(destination).on('error', (err) => {
7
+ console.error('Destination error:', err);
8
+});
0 commit comments