]> git.e2factory.org Git - e2factory.git/commitdiff
bugfix: fix error handling for misconfigured files in source configuration
authorGordon Hecker <gh@emlix.com>
Mon, 22 Mar 2010 11:10:03 +0000 (12:10 +0100)
committerGordon Hecker <gh@emlix.com>
Mon, 22 Mar 2010 12:49:06 +0000 (13:49 +0100)
Signed-off-by: Gordon Hecker <gh@emlix.com>
generic/cache.lua
local/e2tool.lua
local/files.lua

index c8041a450833855a8076bb1380ea1bacece26020..8afd5f3332a0c71610b08c192157d6600cf5864b 100644 (file)
@@ -427,7 +427,7 @@ function cache_file(cache, server, location, flags)
        e2lib.log(4, string.format("cache_file(): %s %s %s %s",
                tostring(cache), tostring(server), tostring(location), 
                tostring(flags)))
-       local e = new_error("caching file failed")
+       local e = new_error("caching file failed: %s:%s", server, location)
        local rc, re
        local ce, re = ce_by_server(cache, server)
        if not ce then
index 5f413e399a23ce9dee10b0533195e7b4cc34d3af..81c076654d5d06fc801a3c6cca6783b9a82db937 100644 (file)
@@ -1280,15 +1280,15 @@ function hashcache_write(info)
 end
 
 function hashcache(info, file)
-       local e = new_error("getting fileid from hash cache")
+       local e = new_error("getting fileid from hash cache failed")
        local rc, re, fileid
        local p, re = info.cache:file_path(file.server, file.location, {})
        if not p then
                return nil, e:cat(re)
        end
-       local s = e2util.stat(p)
+       local s, msg = e2util.stat(p)
        if not s then
-               return nil, e:cat(new_error("stat() failed"))
+               return nil, new_error("%s: %s", p, msg)
        end
        local id = string.format("%s:%s", file.server, file.location)
        local fileid
@@ -1324,7 +1324,7 @@ end
 -- @return an error object on failure
 function verify_remote_fileid(info, file, fileid)
        local rc, re
-       local e = new_error("error calculating remote file id for file %s:%s",
+       local e = new_error("error calculating remote file id for file: %s:%s",
                                                file.server, file.location)
        if not info.cache:cache_enabled(file.server) or
           not e2option.opts["check-remote"] then
@@ -1379,7 +1379,7 @@ end
 function fileid(info, file)
        local fileid
        local re
-       local e = new_error("error calculating file id for file %s:%s",
+       local e = new_error("error calculating file id for file: %s:%s",
                                                file.server, file.location)
        if file.sha1 then
                fileid = file.sha1
@@ -1479,7 +1479,8 @@ end
 -- @return the buildid
 function pbuildid(info, resultname)
        e2lib.log(4, string.format("get pbuildid for %s", resultname))
-       local e = new_error("calculating result id failed")
+       local e = new_error("error calculating result id for result: %s",
+                                                               resultname)
        local r = info.results[resultname]
        if r.pbuildid then
                return r.build_mode.buildid(r.pbuildid)
index 0bedde8d08e37e2b02f5d81553d701dfc754f96c..6e9250dc8ac905287926beb2324f181ffeccc14a 100644 (file)
@@ -310,7 +310,8 @@ end
 -- @return an error string on error
 function files.sourceid(info, sourcename, sourceset)
        local rc, re
-       local e = new_error("%s: error calculating sourceid", sourcename)
+       local e = new_error("error calculating sourceid for source: %s",
+                                                               sourcename)
        rc, re = files.validate_source(info, sourcename)
        if not rc then
                return false, re