Strider-CD / strider-github

Github provider for strider
25 stars 34 forks source link

Improved error when adding project without admin rights. #61

Closed alexfernandez closed 8 years ago

alexfernandez commented 8 years ago

When trying to add a project where you don't have admin rights, right now the error message is:

Error creating project for repo owner/project:
{"results":[],"status":"error","errors":[{"code":500,
"reason":"Failed to setup repo: Bad status code: 404"}]}

Now should show:

"reason":"Failed to setup repo: Cannot create webhooks; are you sure you have admin rights?"}]}

Also added a known issue to the README.md.

Should solve issue https://github.com/Strider-CD/strider-github/issues/60.

alexfernandez commented 8 years ago

Changed in commit a93098f.

knownasilya commented 8 years ago

Published as 2.2.1

alexfernandez commented 8 years ago

Great, thanks! This way other clueless newbies like myself will have it easier :)

knownasilya commented 8 years ago

@alexfernandez really appreciate it. This project can only stay alive because of people like you, who contribute back.

oliversalzburg commented 8 years ago

I'm not sure if this would work, but couldn't we include url in the error message?

As in:

badStatusErr = new Error('Cannot create webhooks; are you sure you have admin rights?\nFeel free to manually create a webhook for ' + url);
knownasilya commented 8 years ago

@oliversalzburg good idea, will add it.

oliversalzburg commented 8 years ago

@knownasilya I'm not sure if the hook will actually work if the registration process failed. As in, maybe it's a different URL for each registration attempt. I don't believe this to be the case, but I'm not sure.

Also, I'm not sure the the way the error is displayed allows for copy&paste of the URL.

If neither is a problem, great :)

knownasilya commented 8 years ago

I guess we shall see :+1: