mirror of
https://github.com/danbulant/koa-plugins
synced 2026-05-19 20:28:36 +00:00
9 lines
216 B
JavaScript
9 lines
216 B
JavaScript
var Stream = require('stream');
|
|
|
|
module.exports = function (stream, error) {
|
|
if (stream instanceof Stream
|
|
&& !~stream.listeners('error').indexOf(error)) {
|
|
stream.on('error', error);
|
|
}
|
|
return stream;
|
|
};
|