diff options
| -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 | |||
| 1136 | ;; This `condition-case' is to catch connection errors. | 1136 | ;; This `condition-case' is to catch connection errors. |
| 1137 | (condition-case error-signal | 1137 | (condition-case error-signal |
| 1138 | (url-retrieve (concat ,location-1 ,file-1) | 1138 | (url-retrieve (concat ,location-1 ,file-1) |
| 1139 | ;; This is to catch execution errors. | ||
| 1139 | (lambda (status) | 1140 | (lambda (status) |
| 1140 | (if-let ((er (plist-get status :error))) | 1141 | (condition-case error-signal |
| 1141 | (when (if (functionp ,async-1) | 1142 | (progn |
| 1142 | (funcall ,async-1) | 1143 | (when-let ((er (plist-get status :error))) |
| 1143 | t) | 1144 | (error "Error retrieving: %s %S" (concat ,location-1 ,file-1) er)) |
| 1144 | (message "Error contacting: %s" (concat ,location-1 ,file-1)) | 1145 | (goto-char (point-min)) |
| 1145 | (signal (car er) (cdr er))) | 1146 | (unless (search-forward "\n\n" nil 'noerror) |
| 1146 | (goto-char (point-min)) | 1147 | (error "Invalid url response in buffer %s" |
| 1147 | (unless (search-forward "\n\n" nil 'noerror) | 1148 | (current-buffer))) |
| 1148 | (error "Invalid url response in buffer %s" | 1149 | (delete-region (point-min) (point)) |
| 1149 | (current-buffer))) | 1150 | ,@body |
| 1150 | (delete-region (point-min) (point)) | 1151 | (kill-buffer (current-buffer))) |
| 1151 | ,@body) | 1152 | (error (when (if (functionp ,async-1) (funcall ,async-1) t) |
| 1152 | (kill-buffer (current-buffer))) | 1153 | (signal (car error-signal) (cdr error-signal)))))) |
| 1153 | nil | 1154 | nil |
| 1154 | 'silent) | 1155 | 'silent) |
| 1155 | (error (when (functionp ,async-1) | 1156 | (error (when (if (functionp ,async-1) (funcall ,async-1) t) |
| 1156 | (funcall ,async-1)) | 1157 | (message "Error contacting: %s" (concat ,location-1 ,file-1)) |
| 1157 | (message "Error contacting: %s" (concat ,location-1 ,file-1)) | 1158 | (signal (car error-signal) (cdr error-signal)))))))) |
| 1158 | (signal (car error-signal) (cdr error-signal))))))) | ||
| 1159 | 1159 | ||
| 1160 | (defun package--check-signature-content (content string &optional sig-file) | 1160 | (defun package--check-signature-content (content string &optional sig-file) |
| 1161 | "Check signature CONTENT against STRING. | 1161 | "Check signature CONTENT against STRING. |