Skip to content

Commit

Permalink
ghub-fetch-{repository,issue,pullreq}: Add errorback argument
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Mar 9, 2020
1 parent b0faada commit a8bf337
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions ghub-graphql.el
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ behave as for `ghub-request' (which see)."

(cl-defun ghub-fetch-repository (owner name callback
&optional until
&key username auth host forge)
&key username auth host forge errorback)
"Asynchronously fetch forge data about the specified repository.
Once all data has been collected, CALLBACK is called with the
data as the only argument."
Expand All @@ -174,11 +174,12 @@ data as the only argument."
:username username
:auth auth
:host host
:forge forge))
:forge forge
:errorback errorback))

(cl-defun ghub-fetch-issue (owner name number callback
&optional until
&key username auth host forge)
&key username auth host forge errorback)
"Asynchronously fetch forge data about the specified issue.
Once all data has been collected, CALLBACK is called with the
data as the only argument."
Expand All @@ -192,11 +193,12 @@ data as the only argument."
:username username
:auth auth
:host host
:forge forge))
:forge forge
:errorback errorback))

(cl-defun ghub-fetch-pullreq (owner name number callback
&optional until
&key username auth host forge)
&key username auth host forge errorback)
"Asynchronously fetch forge data about the specified pull-request.
Once all data has been collected, CALLBACK is called with the
data as the only argument."
Expand All @@ -210,7 +212,8 @@ data as the only argument."
:username username
:auth auth
:host host
:forge forge))
:forge forge
:errorback errorback))

;;; Internal

Expand All @@ -227,7 +230,8 @@ data as the only argument."

(cl-defun ghub--graphql-vacuum (query variables callback
&optional until
&key narrow username auth host forge)
&key narrow username auth host forge
errorback)
"Make a GraphQL request using QUERY and VARIABLES.
See Info node `(ghub)GraphQL Support'."
(unless host
Expand Down Expand Up @@ -258,7 +262,8 @@ See Info node `(ghub)GraphQL Support'."
(funcall callback data))
(lambda (data)
(ghub--graphql-set-mode-line buf nil)
(funcall callback data)))))))
(funcall callback data))))
:errorback errorback)))

(cl-defun ghub--graphql-retrieve (req &optional lineage cursor)
(let ((p (cl-incf (ghub--graphql-req-pages req))))
Expand Down

0 comments on commit a8bf337

Please sign in to comment.