mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
Add ein:query-default-error-callback
This commit is contained in:
parent
01143e1f35
commit
7c04c3927f
1 changed files with 12 additions and 0 deletions
12
ein-query.el
12
ein-query.el
|
@ -57,6 +57,15 @@
|
||||||
|
|
||||||
;;; Functions
|
;;; Functions
|
||||||
|
|
||||||
|
(defun* ein:query-default-error-callback (url &key symbol-status
|
||||||
|
&allow-other-keys)
|
||||||
|
(ein:log 'error
|
||||||
|
"Error (%s) while connecting to %s. Please retry."
|
||||||
|
symbol-status url))
|
||||||
|
|
||||||
|
(defun ein:query-get-default-error-callback (url)
|
||||||
|
(cons #'ein:query-default-error-callback url))
|
||||||
|
|
||||||
(defun* ein:query-ajax (url &rest settings
|
(defun* ein:query-ajax (url &rest settings
|
||||||
&key
|
&key
|
||||||
(cache t)
|
(cache t)
|
||||||
|
@ -121,6 +130,9 @@ is killed immediately after the execution of this function.
|
||||||
(ein:log 'debug "EIN:QUERY-AJAX")
|
(ein:log 'debug "EIN:QUERY-AJAX")
|
||||||
(unless cache
|
(unless cache
|
||||||
(setq url (ein:url-no-cache url)))
|
(setq url (ein:url-no-cache url)))
|
||||||
|
(unless error
|
||||||
|
(setq error (ein:query-get-default-error-callback url))
|
||||||
|
(plist-put settings :error error))
|
||||||
(let* ((url-request-extra-headers headers)
|
(let* ((url-request-extra-headers headers)
|
||||||
(url-request-method type)
|
(url-request-method type)
|
||||||
(url-request-data data)
|
(url-request-data data)
|
||||||
|
|
Loading…
Add table
Reference in a new issue