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
Opening a new issue as a copy of my comment on #11. Unexpected server responses (such as a 401/Not authorized; or if the specified server is not a Gitlab instance) may lead to obscure error messages.
Steps to reproduce
git clone, npm i, cp sample_settings.json settings.json
If you use an actual gitlab instance in step 2, you get the message described in #11 (“Unexpected token o in JSON at position 1”).
If you use some other URL (e.g. Google), you get a different message.
Comment
This needs fixing in the gitlab package and has actually been documented at jdalrymple/gitbeaker#149.
However some changes in this codebase might also be in order. Try making the change I suggested upstream, repeat the steps to reproduce and you will end up with another error:
TypeError: projects.sort is not a function
Something like Array.isArray(projects) inside the callback function on line 16 might do the trick.
The text was updated successfully, but these errors were encountered:
Addendum: After applying the suggested patch to the gitlab package, if I choose google.de as my gitlab.url, there is no error message. The projects variable is an empty array, which the code can handle. This at least is no crash :-).
It would of course be great if we could determine whether the specified server is really a Gitlab server and if not, warn the user (they have leaked their Gitlab access token to a foreign server, after all). But I don’t know if that is possible or feasible.
As of now the error is printed on the console which should contain the body where this should get clearer. I gonna close this because I think it is now stated clearly enough. Reopen if you think otherwise. 👍
Opening a new issue as a copy of my comment on #11. Unexpected server responses (such as a 401/Not authorized; or if the specified server is not a Gitlab instance) may lead to obscure error messages.
Steps to reproduce
Result
If you use an actual gitlab instance in step 2, you get the message described in #11 (“Unexpected token o in JSON at position 1”).
If you use some other URL (e.g. Google), you get a different message.
Comment
This needs fixing in the gitlab package and has actually been documented at jdalrymple/gitbeaker#149.
However some changes in this codebase might also be in order. Try making the change I suggested upstream, repeat the steps to reproduce and you will end up with another error:
TypeError: projects.sort is not a function
Something like
Array.isArray(projects)
inside the callback function on line 16 might do the trick.The text was updated successfully, but these errors were encountered: