Skip to content

authenticate functions swallows errors from github #36

@kriswep

Description

@kriswep

While working on #35 i noticed, the actual request callback implementation in authenticate functions swallows quite a lot of errors returned by gihub.
Eg. when providing a bad code, res.on('end', ..) will be called and just returns an empty error obejct and an null token.

Only way I could get actual errors was when the request timed out.

// .. Relevant code in authenticate function in server.js
  var req = https.request(reqOptions, function(res) {
    res.setEncoding('utf8');
    res.on('data', function (chunk) { body += chunk; });
    res.on('end', function() {
      cb(null, qs.parse(body).access_token);
    });
  });
//..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions