Skip to content

Commit

Permalink
fix on yuan error
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Mar 29, 2013
1 parent 88a00fa commit c9c62de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ exports.sdk.iduri = require('./lib/sdk/iduri');
exports.sdk.yuan = require('./lib/sdk/yuan');
exports.sdk.grunt = require('./lib/sdk/grunt');
exports.sdk.module = require('./lib/sdk/module');

process.on('exit', function() {
console.log();
});
5 changes: 4 additions & 1 deletion lib/sdk/yuan.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ Yuan.prototype.request = function(data, callback) {
callback(err);
return;
}
if (res.statusCode === 404) {
callback('not found');
return;
}
if (data.json && res.headers['content-encoding'] === 'gzip') {
zlib.gunzip(body, function(err, content) {
if (err) {
Expand Down Expand Up @@ -113,7 +117,6 @@ Yuan.prototype.request = function(data, callback) {
req.on('complete', function(res) {
if (res.statusCode === 401) {
log.error('fail', 'authorization is required.');
console.log();
spmrc.set(self.authKey, '');
process.exit(1);
}
Expand Down
3 changes: 0 additions & 3 deletions lib/utils/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ log.error = function() {
var msg = util.format.apply(this, args);

log.log('error', getMsg(category, msg, color.red));
if (category === 'exit') {
console.log();
}
};

log.config = function(options) {
Expand Down

0 comments on commit c9c62de

Please sign in to comment.