Skip to content

Consistent error handling #10

Description

@vogdb

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions