Improve error handling in tramp-adb.el

* lisp/net/tramp-adb.el (tramp-adb-handle-file-local-copy):
Improve error handling.
This commit is contained in:
Michael Albinus 2015-06-21 20:36:14 +02:00
parent a94202b78a
commit 8d4f1e3bd7

View file

@ -575,8 +575,10 @@ Emacs dired can't find files."
(let ((tmpfile (tramp-compat-make-temp-file filename)))
(with-tramp-progress-reporter
v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
(when (tramp-adb-execute-adb-command v "pull" localname tmpfile)
(delete-file tmpfile)
;; "adb pull ..." does not always return an error code.
(when (or (tramp-adb-execute-adb-command v "pull" localname tmpfile)
(not (file-exists-p tmpfile)))
(ignore-errors (delete-file tmpfile))
(tramp-error
v 'file-error "Cannot make local copy of file `%s'" filename))
(set-file-modes