11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciconst fs = require('fs');
41cb0ef41Sopenharmony_ciconst readline = require('readline');
51cb0ef41Sopenharmony_ciconst path = require('path');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciasync function processLineByLine_SymbolAsyncError(filename) {
81cb0ef41Sopenharmony_ci  const fileStream = fs.createReadStream(filename);
91cb0ef41Sopenharmony_ci  const rl = readline.createInterface({
101cb0ef41Sopenharmony_ci    input: fileStream,
111cb0ef41Sopenharmony_ci    crlfDelay: Infinity
121cb0ef41Sopenharmony_ci  });
131cb0ef41Sopenharmony_ci  // eslint-disable-next-line no-unused-vars
141cb0ef41Sopenharmony_ci  for await (const line of rl) {
151cb0ef41Sopenharmony_ci    /* check SymbolAsyncIterator `errorListener` */
161cb0ef41Sopenharmony_ci  }
171cb0ef41Sopenharmony_ci}
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_ciconst f = path.join(__dirname, 'file.txt');
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ci// catch-able SymbolAsyncIterator `errorListener` error
221cb0ef41Sopenharmony_ciprocessLineByLine_SymbolAsyncError(f).catch(common.expectsError({
231cb0ef41Sopenharmony_ci  code: 'ENOENT',
241cb0ef41Sopenharmony_ci  message: `ENOENT: no such file or directory, open '${f}'`
251cb0ef41Sopenharmony_ci}));
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_ciasync function processLineByLine_InterfaceErrorEvent(filename) {
281cb0ef41Sopenharmony_ci  const fileStream = fs.createReadStream(filename);
291cb0ef41Sopenharmony_ci  const rl = readline.createInterface({
301cb0ef41Sopenharmony_ci    input: fileStream,
311cb0ef41Sopenharmony_ci    crlfDelay: Infinity
321cb0ef41Sopenharmony_ci  });
331cb0ef41Sopenharmony_ci  rl.on('error', common.expectsError({
341cb0ef41Sopenharmony_ci    code: 'ENOENT',
351cb0ef41Sopenharmony_ci    message: `ENOENT: no such file or directory, open '${f}'`
361cb0ef41Sopenharmony_ci  }));
371cb0ef41Sopenharmony_ci}
381cb0ef41Sopenharmony_ci
391cb0ef41Sopenharmony_ci// check Interface 'error' event
401cb0ef41Sopenharmony_ciprocessLineByLine_InterfaceErrorEvent(f);
41