From ae51a3c726366c635bda06f2efa0cab47f9ceeaf Mon Sep 17 00:00:00 2001 From: mpeterv Date: Mon, 23 Mar 2015 17:03:22 +0300 Subject: Fix confusing error when unpack fails due to network error Before: `Error: .` After: `Error: Failed downloading http://bad_url` --- src/luarocks/fetch.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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) local url = rockspec.source.url local name = rockspec.name.."-"..rockspec.version local filename = rockspec.source.file - local source_file, store_dir, err, errcode + local source_file, store_dir + local ok, err, errcode if dest_dir then - local ok, err = fs.change_dir(dest_dir) + ok, err = fs.change_dir(dest_dir) if not ok then return nil, err, "dest_dir" end source_file, err, errcode = fetch.fetch_url(url, filename) fs.pop_dir() -- cgit v1.2.3-55-g6feb