Skip to content

Uncatchable error in pack.entry #165

@MorningLightMountain713

Description

@MorningLightMountain713

Hi there, thanks for this great package.

I have an issue where I'm using tar-fs, and by extension, tar-stream

The issue I have is an edge case, where if an end user forgets to add -o filename to the end of the curl command, it crashes my node app, and I'm unable to catch the error. (I'm using express and streaming a response)

It stems from this:

  entry (header, buffer, callback) {
    if (this._finalized || this.destroying) throw new Error('already finalized or destroyed')

and in tar-fs it doesn't catch the error. As this is asynchronous, when I try catch the error, it hasn't happened yet.

    if (stat.isDirectory()) {
      header.size = 0
      header.type = 'directory'
      header = map(header) || header
      return pack.entry(header, onnextentry)
    }

How can I fix this? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions