max-mapper / max-mapper/github-oauth
Consistent error handling
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 71
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
Hi! What do you think about changing https://github.com/maxogden/github-oauth/blob/master/index.js#L45 from
if (!code) return emitter.emit('error', {error: 'missing oauth code'}, resp)
to something like this:
if (!code) {
var err = {error: 'missing oauth code'}
if (cb) {
cb(err)
}
return emitter.emit('error', err, resp)
}
because now if I rely on a callback that is the case when my callback won't be triggered.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at index.js#L45 and trace how the OAuth error path handles callbacks and emits errors. Done means a provided callback receives the missing OAuth code error while the error event continues to be emitted with the response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100