[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 82d22ef8db: Improve Tramp error message

From: Michael Albinus
Subject: master 82d22ef8db: Improve Tramp error message
Date: Sun, 7 Aug 2022 10:36:01 -0400 (EDT)

branch: master
commit 82d22ef8db1838c84dbc512b3f1628a549559504
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Improve Tramp error message
    * lisp/net/tramp-sh.el (tramp-sh-handle-file-local-copy):
    Simplify for empty files.  Better error message.  (Bug#56879)
 lisp/net/tramp-sh.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 38fffadd4e..a2b675cf88 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3270,6 +3270,9 @@ implementation will be used."
       (condition-case err
+          ;; Empty file.
+          ((zerop size))
           ;; `copy-file' handles direct copy and out-of-band methods.
           ((or (tramp-local-host-p v)
                (tramp-method-out-of-band-p v size))
@@ -3285,6 +3288,11 @@ implementation will be used."
               v (format rem-enc (tramp-shell-quote-argument localname))
               "Encoding remote file failed"))
+           ;; Check error.  `rem-enc' could be a pipe, which doesn't
+           ;; flag the error in the first command.
+           (when (zerop (buffer-size (tramp-get-buffer v)))
+             (tramp-error v 'file-error' "Encoding remote file failed"))
                v 3 (format-message
                     "Decoding local file `%s' with `%s'" tmpfile loc-dec)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]