Skip to content

Handle corrupted archive files gracefully #161

@arafatamim

Description

@arafatamim

Often the download process fails to properly fetch the full archive, as a result the unpacking operation refuses to continue until you manually delete the corrupted archive & re-trigger the download. Here's an example:

Shell output
deno v1.20.0 is not installed. do you want to install it? (Y/n)
downloading https://dl.deno.land/release/v1.20.0/deno-x86_64-unknown-linux-gnu.zip
Version has been found
Deno v1.20.0 has been downloaded
Archive:  /home/tamim/.dvm/versions/1.20.0/deno.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /home/tamim/.dvm/versions/1.20.0/deno.zip or
        /home/tamim/.dvm/versions/1.20.0/deno.zip.zip, and cannot find /home/tamim/.dvm/versions/1.20.0/deno.zip.ZIP, period.
thread 'main' panicked at 'assertion failed: unpack_status.success()', src/commands/install.rs:179:3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

dvm should gracefully handle these cases by automatically deleting & re-downloading the release instead of just panic-quitting.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions