Skip to content

Instantly share code, notes, and snippets.

@blakmatrix
Created June 22, 2012 19:21
Show Gist options
  • Save blakmatrix/2974610 to your computer and use it in GitHub Desktop.
Save blakmatrix/2974610 to your computer and use it in GitHub Desktop.
var client = github.client({
username: username,
password: password
});
var endpoint = '/repos/' + username + '/' + repo;
client.del(endpoint, function (err, status, body) {
if (err) {
return cb(err);
}
if (status === 204) { //Status: 204 No Content
app.log.info('Succesfully deleted ' + endpoint.blue);
return cb(null, 'OK');
}
});
@blakmatrix
Copy link
Author

/home/blakmatrix/projects/node-migrator-bot/node_modules/octonode/lib/octonode/client.js:72
return callback(new Error(body.message));
^
TypeError: undefined is not a function
at Client.errorHandle (/home/blakmatrix/projects/node-migrator-bot/node_modules/octonode/lib/octonode/client.js:72:16)
at Request._callback (/home/blakmatrix/projects/node-migrator-bot/node_modules/octonode/lib/octonode/client.js:137:22)
at Request.callback (/home/blakmatrix/projects/node-migrator-bot/node_modules/request/main.js:119:22)
at Request. (native)
at Request.emit (events.js:70:17)
at Request. (/home/blakmatrix/projects/node-migrator-bot/node_modules/request/main.js:521:16)
at Request.emit (events.js:67:17)
at IncomingMessage. (/home/blakmatrix/projects/node-migrator-bot/node_modules/request/main.js:483:14)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.parserOnMessageComplete as onMessageComplete

@pksunkara
Copy link

var client = github.client({
    username: username,
    password: password
  });
  var endpoint = '/repos/' + username + '/' + repo;

  client.del(endpoint, {}, function (err, status, body) {
    if (err) {
      return cb(err);
    }
    if (status === 204) { //Status: 204 No Content
      app.log.info('Succesfully deleted ' + endpoint.blue);
      return cb(null, 'OK');
    } 
});

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