mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 01:21:38 -05:00
Refactor ein-query.el: better debugging message
This commit is contained in:
parent
625929f419
commit
25f67b9874
1 changed files with 11 additions and 6 deletions
|
@ -165,6 +165,15 @@ is killed immediately after the execution of this function.
|
|||
(set-process-query-on-exit-flag (get-buffer-process buffer) nil)
|
||||
buffer))
|
||||
|
||||
(defun ein:query-ajax--parse-data (parser status-error)
|
||||
"Run PARSER in current buffer if STATUS-ERROR is nil,
|
||||
then kill the current buffer."
|
||||
(let ((buffer (current-buffer))) ; NOTE: `parser' could change buffer...
|
||||
(unwind-protect
|
||||
(when (and parser (not status-error))
|
||||
(funcall parser))
|
||||
(kill-buffer buffer))))
|
||||
|
||||
(defun* ein:query-ajax-callback (status &key
|
||||
(headers nil)
|
||||
(parser nil)
|
||||
|
@ -181,15 +190,11 @@ is killed immediately after the execution of this function.
|
|||
(ein:log 'debug "(buffer-string) =\n%s" (buffer-string))
|
||||
|
||||
(ein:query-ajax-cancel-timer)
|
||||
(let* ((buffer (current-buffer)) ; `parser' could change buffer...
|
||||
(response-status url-http-response-status)
|
||||
(let* ((response-status url-http-response-status)
|
||||
(status-code-callback (cdr (assq response-status status-code)))
|
||||
(status-error (plist-get status :error))
|
||||
(canceled ein:%query-ajax-canceled%)
|
||||
(data (unwind-protect
|
||||
(if (and parser (not status-error))
|
||||
(funcall parser))
|
||||
(kill-buffer buffer))))
|
||||
(data (ein:query-ajax--parse-data parser status-error)))
|
||||
(ein:log 'debug "data = %s" data)
|
||||
(ein:log 'debug "canceled = %s" canceled)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue