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

Handle common errors #6

Open
5 of 11 tasks
jfmengels opened this issue Mar 6, 2016 · 24 comments
Open
5 of 11 tasks

Handle common errors #6

jfmengels opened this issue Mar 6, 2016 · 24 comments

Comments

@jfmengels
Copy link
Collaborator

jfmengels commented Mar 6, 2016

  • Could not find .all-contributorsrc file.
  • projectOwner is not set in .all-contributorsrc file.
  • projectName is not set in .all-contributorsrc file.
  • files was overriden in .all-contributorsrc file and is empty.
  • Could not find some of the files to inject into. If adding a contributor, the addition should still take place.
  • Could not find any injection tags. If adding a contributor, the addition should still take place.
  • No login when adding a contributor.
  • No contribution types when adding a contributor.
  • Login not found when adding a contributor.
  • Network error adding a contributor.
  • Contribution type not found.

In all of these cases: Should print some helpful error and exit.

If you wish to contribute, first off: thanks!
Feel free to tackle one or a few of these problems, no need to do them all (considering the number of them, I'd actually prefer multiple PRs).

@jfmengels
Copy link
Collaborator Author

(it is still beginner-friendly, just wanted the issue to be less polluted by too many labels ;) )

@boneskull
Copy link

Could not find some of the files to inject into. If adding a contributor, the addition should still take place.

fwiw, having this one:

$ node_modules/.bin/all-contributors init
? What's the name of the repository? mocha
? Who is the owner of the repository? mochajs
? In which file should contributors be listed? CONTRIBUTORS.md
? Do you want a badge tallying the number of contributors? Yes
? In which file should the badge be shown? README.md
? How big should the avatars be? (in px) 100
? Do you want this badge to auto-commit when contributors are added? Yes
{ Error: ENOENT: no such file or directory, open 'CONTRIBUTORS.md'
    at Error (native)
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'CONTRIBUTORS.md' }

@fadc80
Copy link
Contributor

fadc80 commented Oct 14, 2016

Considering your first item.

Could not find .all-contributorsrc file.

Do you expect the following code snnipet from cli.js to be changed too?

  try {
    fs.statSync(argv.config);
  } catch (error) { // No config file --> first time using the command
    return cb('init');
  }

I mean, if .all-contributorsrc file doesn't exist, then the init command will not be run by default anymore. Instead, an error message will be shown.

I ask because this code appears to ensure that the file will always exist.

@jamesplease
Copy link
Contributor

Network error adding a contributor.

This should differentiate different types of network errors, I think, such as no connection and rate limiting.

@M-ZubairAhmed
Copy link
Contributor

Can i take projectOwner error?

@kentcdodds
Copy link
Collaborator

Feel free!

@M-ZubairAhmed
Copy link
Contributor

M-ZubairAhmed commented Dec 28, 2017

can someone explain me these two points

 Could not find some of the files to inject into. If adding a contributor, the addition should still take place. 
Could not find any injection tags. If adding a contributor, the addition should still take place.

  • What exactly is some files ?
  • What is injection tag?

@M-ZubairAhmed
Copy link
Contributor

Sorry for bugging out guys . I just have free time at work these days, so though i should contribute to open source during my day job till my project starts

@machour
Copy link
Collaborator

machour commented Dec 28, 2017

Hey @M-ZubairAhmed, no worries, but don't forget that we're on different timezones + we all got things to do outside OSS :)

some files: The files where the markdown is generated (README.md in this repo), but other files can be specified in the files entry of config.

injection tag: In order for the lib to know WHERE in the given files (some files) it should inject the generated markdown file, we have a HTML comments like this: <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> and <!-- ALL-CONTRIBUTORS-LIST:END -->. These are referred to as injection tags.

@M-ZubairAhmed
Copy link
Contributor

M-ZubairAhmed commented May 30, 2018

No login when adding a contributor.

This means that contributor's github does not exists?

@kentcdodds
Copy link
Collaborator

I think so.

@M-ZubairAhmed
Copy link
Contributor

M-ZubairAhmed commented Jun 7, 2018

Login not found when adding a contributor.

No login when adding a contributor.

Do they both mean the same, github username of the contributor being added not found?

@kentcdodds
Copy link
Collaborator

Login not found when adding a contributor.

This would happen if I specify a contributor login and that user isn't found.

No login when adding a contributor.

This would happen if I'm trying to add a contributor but don't specify a login.

I think....

@M-ZubairAhmed
Copy link
Contributor

@kentcdodds oh ok makes sense. Let me give it a stab

@Berkmann18 Berkmann18 pinned this issue Jan 31, 2019
@jakebolam jakebolam unpinned this issue Feb 7, 2019
@Berkmann18 Berkmann18 pinned this issue Feb 19, 2019
@erdahuja
Copy link
Contributor

erdahuja commented Feb 22, 2019

What's a good starting point for these error? I'd like to take one like * projectName.

@Berkmann18
Copy link
Member

Berkmann18 commented Feb 22, 2019

@erdahuja Well, have a look at how these errors are currently handled and see if you can improve them in a way that (as @jfmengels said in the OP) it shows a helpful and meaningful error and that it does the appropriate action (e.g: exit or/and fixing).

@erdahuja
Copy link
Contributor

@Berkmann18 @kentcdodds i am unable add PR for it. i have done two check list points. Can you please consider adding me as a user? Or a PR from fork would work.

erdahuja added a commit to erdahuja/all-contributors-cli that referenced this issue Feb 23, 2019
@M-ZubairAhmed
Copy link
Contributor

@erdahuja projectName and projectOwner is already done and merged at #80
@jfmengels can you please edit the #6 (comment) to update whats done

@Berkmann18
Copy link
Member

@erdahuja You should be able to submit a PR, which you seem to have done.

@erdahuja
Copy link
Contributor

Update:

Login not found when adding a contributor.

No login when adding a contributor.

PR for these is submitted. Next I am doing :

Contribution type not found.

@jfmengels Please update the checklist comment.

erdahuja added a commit to erdahuja/all-contributors-cli that referenced this issue Feb 25, 2019
# This is the 1st commit message:
fix:all-contributors#6 added common error handling for username not provided or wrong username provided.

# This is the commit message all-contributors#2:

fix:all-contributors#170 added tests for no username case in github getInfo api.

# This is the commit message all-contributors#3:

fix:all-contributors#170 added tests for no username case in github getInfo api.
@jakebolam
Copy link
Collaborator

Thanks for doing this! Updated description!

@M-ZubairAhmed
Copy link
Contributor

@jakebolam can i take this one
No contribution types when adding a contributor
Just to be sure this means that when adding a collaborator, type of collaboration is not specified ?
for eg all-contributors add <username>

@jakebolam
Copy link
Collaborator

For sure @M-ZubairAhmed. Thank you!

Yes that is correct, if the user doesn't specify contribution types or invalid ones, then throw a meaningful error.

@sinchang sinchang unpinned this issue May 12, 2019
@Berkmann18 Berkmann18 pinned this issue Mar 23, 2021
@LakshmiGayathri19
Copy link

Hello, I am new to contributing to open source and would like to contribute to this project. I would like to take up the task "Contribution type not found". Could you please assign this task to me ?
Thanks in advance :")

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

No branches or pull requests