Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read errors aren't pushed into the stream #284

Closed
Silic0nS0ldier opened this issue Apr 24, 2021 · 0 comments · Fixed by #285
Closed

Read errors aren't pushed into the stream #284

Silic0nS0ldier opened this issue Apr 24, 2021 · 0 comments · Fixed by #285
Assignees
Labels
bug Something isn't working

Comments

@Silic0nS0ldier
Copy link
Member

An issue with error reporting has been identified and needs to be resolved.

  1. The read function is unnecessary marked as async
  2. The exception should be pushed into the stream, but isn't.

vinyl-fs-vpath/src/src.ts

Lines 86 to 114 in f37d98f

/**
* Internal only. Instructs that a new file needs to be pushed out.
*/
async _read() {
while (this.files.length > 0) {
const { actual, virtual } = this.files.pop();
try {
const file = vinylFile.readSync(actual, this.vinylFsSrcOptions);
if (actual !== virtual) {
file.path = virtual;
}
this.logger.trace("Pushing file", { actual, virtual });
this.push(file);
return;
/* c8 ignore next 4 */
} catch (error) {
// This can happen when there are file changes during processing, difficult to test
throw new PluginError("userfrosting/vinyl-fs-vpath", error);
}
}
this.logger.trace("No more files to send");
this.push(null);
return;
}
}

@Silic0nS0ldier Silic0nS0ldier added the bug Something isn't working label Apr 24, 2021
@Silic0nS0ldier Silic0nS0ldier self-assigned this Apr 24, 2021
@Silic0nS0ldier Silic0nS0ldier linked a pull request Apr 24, 2021 that will close this issue
Silic0nS0ldier added a commit that referenced this issue Apr 24, 2021
* Fixed error reporting, improved test coverage

* Removed c8 bailout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant