diff options
author | mpeterv <mpeterval@gmail.com> | 2015-03-23 17:03:22 +0300 |
---|---|---|
committer | mpeterv <mpeterval@gmail.com> | 2015-03-23 17:03:22 +0300 |
commit | ae51a3c726366c635bda06f2efa0cab47f9ceeaf (patch) | |
tree | 05c00abb36689e02d2b4f9d2e6c0fef42e67f2e8 /src | |
parent | 28ade76301133abc3b4ea96faefb51fe59f1c3ad (diff) | |
download | luarocks-ae51a3c726366c635bda06f2efa0cab47f9ceeaf.tar.gz luarocks-ae51a3c726366c635bda06f2efa0cab47f9ceeaf.tar.bz2 luarocks-ae51a3c726366c635bda06f2efa0cab47f9ceeaf.zip |
Fix confusing error when unpack fails due to network error
Before: `Error: .`
After: `Error: Failed downloading http://bad_url`
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/fetch.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua index 980c8fe2..497ae84f 100644 --- a/src/luarocks/fetch.lua +++ b/src/luarocks/fetch.lua | |||
@@ -319,9 +319,10 @@ function fetch.get_sources(rockspec, extract, dest_dir) | |||
319 | local url = rockspec.source.url | 319 | local url = rockspec.source.url |
320 | local name = rockspec.name.."-"..rockspec.version | 320 | local name = rockspec.name.."-"..rockspec.version |
321 | local filename = rockspec.source.file | 321 | local filename = rockspec.source.file |
322 | local source_file, store_dir, err, errcode | 322 | local source_file, store_dir |
323 | local ok, err, errcode | ||
323 | if dest_dir then | 324 | if dest_dir then |
324 | local ok, err = fs.change_dir(dest_dir) | 325 | ok, err = fs.change_dir(dest_dir) |
325 | if not ok then return nil, err, "dest_dir" end | 326 | if not ok then return nil, err, "dest_dir" end |
326 | source_file, err, errcode = fetch.fetch_url(url, filename) | 327 | source_file, err, errcode = fetch.fetch_url(url, filename) |
327 | fs.pop_dir() | 328 | fs.pop_dir() |