File tree 2 files changed +45
-9
lines changed
2 files changed +45
-9
lines changed Original file line number Diff line number Diff line change @@ -216,15 +216,23 @@ refreshed during the current session."
216
216
(car archive) i count) t ))
217
217
(spacemacs//redisplay)
218
218
(setq i (1+ i))
219
- (unless (eq 'error (with-timeout
220
- (dotspacemacs-elpa-timeout
221
- (progn
222
- (spacemacs-buffer/append
223
- (format
224
- " \n Error while contacting %s repository!"
225
- (car archive)))
226
- 'error ))
227
- (url-retrieve-synchronously (cdr archive))))
219
+ (unless (eq 'error
220
+ (with-timeout
221
+ (dotspacemacs-elpa-timeout
222
+ (progn
223
+ (spacemacs-buffer/append
224
+ (format
225
+ " \n Error connection time out for %s repository!"
226
+ (car archive)))
227
+ 'error ))
228
+ (condition-case err
229
+ (url-retrieve-synchronously (cdr archive))
230
+ ('error
231
+ (spacemacs-buffer/append
232
+ (format
233
+ " \n Error while contacting %s repository!"
234
+ (car archive)))
235
+ 'error ))))
228
236
(let ((package-archives (list archive)))
229
237
(package-refresh-contents ))))
230
238
(package-read-all-archive-contents )
Original file line number Diff line number Diff line change 51
51
(should (equal '((" melpa" . " https://melpa.org/packages/" ))
52
52
(configuration-layer//resolve-package-archives input)))))
53
53
54
+ ; ; ---------------------------------------------------------------------------
55
+ ; ; configuration-layer/retrieve-package-archives
56
+ ; ; ---------------------------------------------------------------------------
57
+
58
+ (ert-deftest test-retrieve-package-archives--catch-time-out-error ()
59
+ (let ((package-archives '((" gnu" . " https://elpa.gnu.org/packages/" )))
60
+ (configuration-layer--package-archives-refreshed nil )
61
+ (dotspacemacs-elpa-timeout -1 ))
62
+ (mocker-let
63
+ ((message (format-string &rest args)
64
+ ((:record-cls 'mocker-stub-record :output nil ))))
65
+ (configuration-layer/retrieve-package-archives))))
66
+
67
+ (ert-deftest test-retrieve-package-archives--catch-connection-errors ()
68
+ (let ((package-archives '((" gnu" . " https://elpa.gnu.org/packages/" )))
69
+ (configuration-layer--package-archives-refreshed nil ))
70
+ (cl-letf (((symbol-function 'url-retrieve-synchronously )
71
+ (lambda (x )
72
+ (signal 'file-error '(" make client process failed"
73
+ " connection refused"
74
+ :name " elpa.gnu.org"
75
+ :buffer dummy
76
+ :host " elpa.gnu.org"
77
+ :service 443
78
+ :nowait nil ))))
79
+ ((symbol-function 'message ) 'ignore ))
80
+ (configuration-layer/retrieve-package-archives))))
81
+
54
82
; ; ---------------------------------------------------------------------------
55
83
; ; configuration-layer//make-layers
56
84
; ; ---------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments