Ignore errors in fetching github notifications with network issue.

This commit is contained in:
Vincent Zhang 2019-01-04 15:37:41 +08:00
parent 7285c433ae
commit 47bed3c0a4

View file

@ -4,7 +4,7 @@
;; Author: Vincent Zhang <seagle0128@gmail.com> ;; Author: Vincent Zhang <seagle0128@gmail.com>
;; Homepage: https://github.com/seagle0128/doom-modeline ;; Homepage: https://github.com/seagle0128/doom-modeline
;; Version: 1.4.2 ;; Version: 1.4.3
;; Package-Requires: ((emacs "25.1") (all-the-icons "1.0.0") (shrink-path "0.2.0") (eldoc-eval "0.1") (dash "2.11.0")) ;; Package-Requires: ((emacs "25.1") (all-the-icons "1.0.0") (shrink-path "0.2.0") (eldoc-eval "0.1") (dash "2.11.0"))
;; Keywords: faces mode-line ;; Keywords: faces mode-line
@ -1850,10 +1850,11 @@ mouse-3: Describe current input method")
(require 'ghub nil t) (require 'ghub nil t)
(when (fboundp 'ghub-get) (when (fboundp 'ghub-get)
(with-timeout (10) (with-timeout (10)
(ignore-errors
(ghub-get "/notifications" (ghub-get "/notifications"
nil nil
:query '((notifications . "true")) :query '((notifications . "true"))
:noerror t)))) :noerror t)))))
(lambda (result) (lambda (result)
(setq doom-modeline--github-notifications-number (setq doom-modeline--github-notifications-number
(length result)))))) (length result))))))