]> git.e2factory.org Git - e2factory.git/commitdiff
transport: improve error message signal ratio
authorTobias Ulmer <tu@emlix.com>
Wed, 2 Nov 2016 18:00:34 +0000 (19:00 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:18 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/transport.lua

index 68d065707f2f8a099eb8fd0ba06f35c2de37d22c..028aa256d82133c9b6708931ffcdd8abc8d07a35 100644 (file)
@@ -163,7 +163,8 @@ function transport.fetch_file(surl, location, destdir, destname)
     end
 
     local rc, re
-    local e = err.new("transport: fetching file failed")
+    local e = err.new("downloading %s/%s to %s/%s",
+        surl, location, destdir, destname)
     local u, re = url.parse(surl)
     if not u then
         return false, e:cat(re)
@@ -347,12 +348,14 @@ function transport.push_file(sourcefile, durl, location, push_permissions, try_h
     assert(try_hardlink == nil or type(try_hardlink) == "boolean")
 
     local rc, e
-    e = err.new("error pushing file to server")
     durl = string.format("%s/%s", durl, location)
+    e = err.new("uploading %s to %s/%s", sourcefile, durl, location)
+
     local u, re = url.parse(durl)
     if not u then
         return false, e:cat(re)
     end
+
     if u.transport == "file" then
         local destdir = string.format("/%s", e2lib.dirname(u.path))
         local destname = e2lib.basename(u.path)
@@ -449,8 +452,8 @@ function transport.push_file(sourcefile, durl, location, push_permissions, try_h
             return false, re
         end
     else
-        e:append("push_file is not implemented for this transport: %s",
-        u.transport)
+        e:cat("uploading files to %s:// transports is not supported",
+            u.transport)
         return false, e
     end
     return true, nil