stream.js: additional error handling