You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had some issues with initial auth token setup (I think probably due to an old ghub as per #5), which resulted in the token being created on GitHub but not correctly set up locally (I guess in .authinfo). When I tried to step through again, I think I found a bug in the code which tries to warn the user that there is already an auth token on GitHub of the same name. The problem seems to be in this part of ghub--confirm-create-token:
If an auth token already exists on GitHub of the name we want to
use, the error returned was not being interpreted correctly.
A typical response is something like:
(ghub-http-error 422 "Unprocessable Entity (Added by DAV)" "/authorizations" ((message . "Validation Failed") (errors ((resource . "OauthAccess") (code . "already_exists") (field . "description"))) (documentation_url . "https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization")))
Therefore the error's payload is obtained via (nth 4 ...) not (nth 3
...), and then (let-alist ... .errors) returns a list not a single
error, so we need to use two nested let-alist invocations to obtain
.code.
Fixesmagit#77.
I had some issues with initial auth token setup (I think probably due to an old ghub as per #5), which resulted in the token being created on GitHub but not correctly set up locally (I guess in
.authinfo
). When I tried to step through again, I think I found a bug in the code which tries to warn the user that there is already an auth token on GitHub of the same name. The problem seems to be in this part ofghub--confirm-create-token
:I stepped through with
edebug
and saw this asghub--create-token-error
:So the first problem is that
(nth 3 ghub--create-token-error)
evaluates to"/authorizations"
not the payload.Secondly,
.errors
returns a list of errors, not a single error, so you can't use.code
on it directly; instead you need another nested let-alist.I'll submit a PR with a fix.
Here's the full stacktrace for reference:
The text was updated successfully, but these errors were encountered: