Commit e276b428 authored by Artur Malabarba's avatar Artur Malabarba

* lisp/emacs-lisp/package.el (package--with-work-buffer-async):

Fix error handling.
parent 0592cefd
......@@ -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)
(message "Error contacting: %s" (concat ,location-1 ,file-1))
(signal (car er) (cdr er)))
(condition-case error-signal
(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"
(delete-region (point-min) (point))
(kill-buffer (current-buffer)))
(error (when (if (functionp ,async-1) (funcall ,async-1) t)
(signal (car error-signal) (cdr error-signal))))))
(error (when (functionp ,async-1)
(funcall ,async-1))
(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)))))))
(signal (car error-signal) (cdr error-signal))))))))
(defun package--check-signature-content (content string &optional sig-file)
"Check signature CONTENT against STRING.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment