-
Notifications
You must be signed in to change notification settings - Fork 144
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
Comments
(it is still beginner-friendly, just wanted the issue to be less polluted by too many labels ;) ) |
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' } |
Considering your first item.
Do you expect the following code snnipet from 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. |
This should differentiate different types of network errors, I think, such as no connection and rate limiting. |
Can i take projectOwner error? |
Feel free! |
can someone explain me these two points
|
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 |
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 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: |
This means that contributor's github does not exists? |
I think so. |
Do they both mean the same, github username of the contributor being added not found? |
This would happen if I specify a contributor login and that user isn't found.
This would happen if I'm trying to add a contributor but don't specify a login. I think.... |
@kentcdodds oh ok makes sense. Let me give it a stab |
What's a good starting point for these error? I'd like to take one like * projectName. |
@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). |
@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. |
…rovided or wrong username provided.
@erdahuja projectName and projectOwner is already done and merged at #80 |
@erdahuja You should be able to submit a PR, which you seem to have done. |
Update:
PR for these is submitted. Next I am doing :
@jfmengels Please update the checklist comment. |
# 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.
Thanks for doing this! Updated description! |
@jakebolam can i take this one |
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. |
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 ? |
.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.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).
The text was updated successfully, but these errors were encountered: