Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add common error handling for missing or wrong username #171

Merged
merged 2 commits into from
Mar 17, 2019

Conversation

erdahuja
Copy link
Contributor

@erdahuja erdahuja commented Feb 23, 2019

What:

  1. Added username validation in inquirer prompt
  2. Add validation for wrong username while fetching info from github.

issue #6

Why:

  1. More informative errors.
  2. Better usability of package .

How:

  1. Added validation inquirer prompt.
  2. throwing error for no username in getUserInfo for github

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

Copy link
Member

@Berkmann18 Berkmann18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you follow the Angular commit convention as explained in the contribution guidelines.

@erdahuja
Copy link
Contributor Author

Make sure you follow the Angular commit convention as explained in the contribution guidelines.

Okay, thanks. I'll rebase and update once review process is completed. I think it's done now. since my doubt is resolved. Thanks!

@@ -65,6 +65,10 @@ test('handle errors', async () => {
await rejects(getUserInfo('nodisplayname'))
})

test('Throw error when no username is provided', () => {
expect(getUserInfo).toThrow('No login when adding a contributor. Please specify a username.')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sinchang I did it like this. Re read documentation. Actually expect should call the function not us.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Berkmann18 friendly ping

@erdahuja erdahuja changed the title fix:#170,#6 added common error handling for username not provided or wrong… fix: add common error handling for missing or wrong username Feb 25, 2019
@erdahuja erdahuja force-pushed the issue-170 branch 2 times, most recently from 28c933e to c9a470b Compare February 25, 2019 14:01
@Berkmann18 Berkmann18 merged commit 3e046b7 into all-contributors:master Mar 17, 2019
@all-contributors-release-bot
Copy link
Member

🎉 This PR is included in version 6.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants