jbang
jbang copied to clipboard
if GITHUB_TOKEN is invalid everyting fails
export GITHUB_TOKEN=notvalid
jbang gavsearch@jbangdev
result in what seems like you made a mistake
[jbang] [ERROR] Could not download https://github.com/jbangdev/jbang-catalog/blob/HEAD/jbang-catalog.json
[jbang] Run with --verbose for more details. The --verbose must be placed before the jbang command. I.e. jbang --verbose run [...]
if you run with --verbose you get lots of 404 issues.
could we somehow improve that error message or give hint that issue might be bad token?
Not sure how, it's GH that gives the 404s. They might be doing this on purpose so you can't go trying tokens, just like many sites do with passwords, they won't tell you if it's the username or the password that's wrong or they might be giving out important information ("ah, password wrong, so at least the username is correct")
yes - I get why it happens - its just that from a naive user things works great until it doesn't when your token expires and you had set GITHUB_TOKEN for all kind of reasons unrelated to jbang - hence you have not explicitly done it for jbang and thus the error takes a while to figure out as no indication to user.
Yeah, but that might mean there just isn't a way to give a more meaningful message I guess. Github won't tell us. Unless you want to give warnings like "couldn't find script or it could be that your GITHUB_TOKEN has expired".