diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-07-17 23:00:24 +0100 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-07-17 23:42:16 +0100 |
commit | e276b42800dc2b8263ebf24d7c449f53c819307b (patch) | |
tree | 416ba8dea9ef87cdf8dbe4ecf9e88f7fe4b6e186 /lisp/emacs-lisp | |
parent | 0592cefd03f1de2f04b721d07a16e6e0a9e48f73 (diff) | |
download | emacs-e276b42800dc2b8263ebf24d7c449f53c819307b.tar.gz emacs-e276b42800dc2b8263ebf24d7c449f53c819307b.tar.bz2 emacs-e276b42800dc2b8263ebf24d7c449f53c819307b.zip |
* lisp/emacs-lisp/package.el (package--with-work-buffer-async):
Fix error handling.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/package.el | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index c256923ca21..fc5ef0b62c0 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1136,26 +1136,26 @@ For a description of the other arguments see ;; This `condition-case' is to catch connection errors. (condition-case error-signal (url-retrieve (concat ,location-1 ,file-1) + ;; This is to catch execution errors. (lambda (status) - (if-let ((er (plist-get status :error))) - (when (if (functionp ,async-1) - (funcall ,async-1) - t) - (message "Error contacting: %s" (concat ,location-1 ,file-1)) - (signal (car er) (cdr er))) - (goto-char (point-min)) - (unless (search-forward "\n\n" nil 'noerror) - (error "Invalid url response in buffer %s" - (current-buffer))) - (delete-region (point-min) (point)) - ,@body) - (kill-buffer (current-buffer))) + (condition-case error-signal + (progn + (when-let ((er (plist-get status :error))) + (error "Error retrieving: %s %S" (concat ,location-1 ,file-1) er)) + (goto-char (point-min)) + (unless (search-forward "\n\n" nil 'noerror) + (error "Invalid url response in buffer %s" + (current-buffer))) + (delete-region (point-min) (point)) + ,@body + (kill-buffer (current-buffer))) + (error (when (if (functionp ,async-1) (funcall ,async-1) t) + (signal (car error-signal) (cdr error-signal)))))) nil 'silent) - (error (when (functionp ,async-1) - (funcall ,async-1)) - (message "Error contacting: %s" (concat ,location-1 ,file-1)) - (signal (car error-signal) (cdr error-signal))))))) + (error (when (if (functionp ,async-1) (funcall ,async-1) t) + (message "Error contacting: %s" (concat ,location-1 ,file-1)) + (signal (car error-signal) (cdr error-signal)))))))) (defun package--check-signature-content (content string &optional sig-file) "Check signature CONTENT against STRING. |