phallstrom / AlfredGist

An workflow for Alfred to create Gists from your clipboard contents or selected file(s).
159 stars 10 forks source link

ERROR: An API error occurred #25

Closed walterdolce closed 9 years ago

walterdolce commented 9 years ago

Hi, I've installed AlfredGist by following the instruction in the README file. I've created and successfully set the token but whenever I try to do anything with this extension I get the error "ERROR: An API error occurred".

FYI - I don't have any Alfred Gist or something like that in the authorized applications on GitHub. The extension didn't ask anything like that (and in case is required, it's not on the README).

phallstrom commented 9 years ago

Sorry for the long delay. So you have the personal access token created in github and 'gist' is the only thing that's checked right? I just went through the steps (turns out I don't have my own workflow installed :) and it's working for me right now.

Any chance it didn't get copied in correctly? Verify that when you type 'gistconfig' the information is there correctly and that the API server is 'api.github.com'.

walterdolce commented 9 years ago

Yep. Everything seems to be set correctly. I will double check again though and confirm whether it works or not.

Also if you knew a way I could debug this would be great.

phallstrom commented 9 years ago

@walterdolce If you open a terminal and cd into the workflow's directory (or just download this repo and use that), then copy something innocent to the clipboard you can then run sh -x gist.sh gist which will display a ton of output. Look for the lines with curl in them to see what the response is. Or post it here, or send it to me privately as your token key will be in the output.

walterdolce commented 9 years ago

@phallstrom never mind. Apparently I was just being silly. I double checked the config params and something was set up incorrecly. It's working fine now so I'll close this issue. Thanks for the support :)

gandalfsaxe commented 5 years ago

@phallstrom I got the same error and suspected that the API server was incorrectly set. For me it was set to https://github.com/phallstrom/AlfredGist by default, which obviously can't be true.

Only by finding this issue did I find the correct server address: api.github.com. Shouldn't this be default?

But it works now 🙂

phallstrom commented 5 years ago

@GandalfSaxe It is the default. See https://github.com/phallstrom/AlfredGist/blob/master/functions.sh#L92

Any chance you had that URL copied and did gistconfig and selected one of the options unintentionally?

gandalfsaxe commented 5 years ago

Ah yes that's probably what happened 👍